Search found 25 matches

by Porkypie
Sat Feb 09, 2013 3:46 pm
Forum: PHP
Topic: content won't display
Replies: 1
Views: 520

content won't display

Hey! I made this "while loop", but the content that comes after my loops won't display anymore. Can anyone tell me why? here's the code: [syntax=php] <?php $result = mysql_query("SELECT `gebruikers_naam`, `achternaam`, `voornaam`, `email`, `telefoon` FROM gebruikers"); echo mysql...
by Porkypie
Tue Jan 15, 2013 8:25 pm
Forum: PHP
Topic: is my query correct?
Replies: 5
Views: 935

Re: is my query correct?

Ok it's not over yet.

I also want the form to search in all columns.

can i put a certain value in the form option or should i do it in php?

and how should I do it?

Also how can I display all results if i leave my textfield empty in the form?
by Porkypie
Tue Jan 15, 2013 8:13 pm
Forum: PHP
Topic: is my query correct?
Replies: 5
Views: 935

Re: is my query correct?

found the problem :D

query was wrong
by Porkypie
Tue Jan 15, 2013 8:02 pm
Forum: PHP
Topic: is my query correct?
Replies: 5
Views: 935

Re: is my query correct?

I know it's unsecured but it's only local and won't come online these are the errors I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tar') ORDER by ('studentnummer') asc' at line 1 Warning: mysql_fetch_arra...
by Porkypie
Tue Jan 15, 2013 6:22 pm
Forum: PHP
Topic: is my query correct?
Replies: 5
Views: 935

is my query correct?

Hey all, I'm trying to do an assignment for school. Our website should be able to search in our database. I think this could be done easier but we have to do it like this. Anyways I could use some help and I was hoping to find it here. I made the following form: [syntax=xhtml] <form action="&qu...
by Porkypie
Tue Jan 08, 2013 11:16 pm
Forum: PHP
Topic: too many redirects
Replies: 5
Views: 1038

Re: too many redirects

I've tried out what you've said but it didn't work.
I had another look at the tutorial and found out what i've done wrong.

The script_name has to be written in caps...
[syntax=php]
$page = substr(end(explode('/', $_SERVER['script_name'])), 0, -4);
[/syntax]

thanks for your help ;)
by Porkypie
Tue Jan 08, 2013 4:15 pm
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

good to know I think there's something wrong in this part of my code: [syntax=php] function create_conversation($user_ids, $subject, $body){ $subject = mysql_real_escape_string(htmlentities($subject)); $body = mysql_real_escape_string(htmlentities($body)); mysql_query("insert into `conversation...
by Porkypie
Tue Jan 08, 2013 10:13 am
Forum: PHP
Topic: too many redirects
Replies: 5
Views: 1038

Re: too many redirects

I guess the error should be in this code. Every page gives the redirection error and this one is included in each one of them: [syntax=php] <?php session_start(); $exceptions = array('register', 'login'); $page = substr(end(explode('/', $_SERVER['script_name'])), 0, -4); if (in_array($page, $excepti...
by Porkypie
Tue Jan 08, 2013 9:02 am
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

The mistake was actually in the query. I've rechecked it before I posted this but didn't notice a thing. Thanks again! when I try to send a message with the form and submit nothing happens. Neither does it add anything to my database. [syntax=php]<?php if (isset($_POST['to'], $_POST['subject'], $_po...
by Porkypie
Mon Jan 07, 2013 11:29 pm
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

I managed to figure it out. there was a mistake in my code. after removing the: [syntax=php]return mysql_error();[/syntax] The error is gone but sadly the other error comes back. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\Users\B_Kortekaas\Desktop\Stud...
by Porkypie
Mon Jan 07, 2013 11:02 pm
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

I put that line in to prevent an error from happening so when i remove it is just get the old error back.
by Porkypie
Mon Jan 07, 2013 7:40 am
Forum: PHP
Topic: mysql_fetch_assoc extension
Replies: 10
Views: 5386

Re: mysql_fetch_assoc extension

I get the following error:

Unknown column 'user_username' in 'field list'

my column was called 'user_name' so i've changed all of the "user_username" to "user_name".

The Unknown column... error is gone now but the old error remains.
by Porkypie
Mon Jan 07, 2013 12:39 am
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

[syntax=php]function fetch_conversation_summery(){ $sql = "select `conversations`.`conversation_id`, `conversations`.`conversations_subject`, max(`conversations_messages`.`message_date`) as `conversation_last_reply` max(`conversations_messages`.`message_date`) > `conversations_members`.`convers...
by Porkypie
Mon Jan 07, 2013 12:35 am
Forum: PHP
Topic: mysql_fetch_assoc extension
Replies: 10
Views: 5386

Re: mysql_fetch_assoc extension

Here's the function: [syntax=php]Function fetch_users(){ $result = mysql_query('select `user_id` as `id`, `user_username` as `username` from `users`'); return mysql_error(); $users = array(); while (($row = mysql_fetch_assoc($result)) !== false){ $users[] = $row; } return $users; }[/syntax] I guess ...
by Porkypie
Sun Jan 06, 2013 8:49 pm
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

Finally found what was going wrong. Password was encrypted >.< sadly this still doesn't fix everything. Warning: Invalid argument supplied for foreach() in C:\.........\www\1\core\pages\inbox.page.inc.php on line 36 [syntax=php] <?php $errors = array(); if (isset($_GET['delete_conversation'])){ if (...
by Porkypie
Sun Jan 06, 2013 7:43 pm
Forum: PHP
Topic: too many redirects
Replies: 5
Views: 1038

too many redirects

Hey, is there an easy way too find out why my php page keeps looping? I've tried to clear my cookies already because the last time it happened it was because of that. Also it's quite weird it's happening because the first time I tried my page I just received a php error. I fixed it but then the &quo...
by Porkypie
Sun Jan 06, 2013 3:56 pm
Forum: PHP
Topic: mysql_fetch_assoc extension
Replies: 10
Views: 5386

Re: mysql_fetch_assoc extension

I got the $user[] = $row; part out of the tutorial. And I'm a beginner with PHP so I wouldn't know why it wouldn't work. At the moment it don't get an error message for it but I guess it won't stay like that if you tell it won't work. But after changing the code like you told me to, everything seems...
by Porkypie
Sun Jan 06, 2013 10:53 am
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

I think these are the files you need: [syntax=php] <h1>login</h1> <?php if (isset($_POST['user_name'], $_POST['user_password'])){ echo '<div class="msg error">Login failed.</div>'; } ?> <form action="index.php?page=login" method="post"> <div> <label for="user_name&...
by Porkypie
Sun Jan 06, 2013 12:23 am
Forum: PHP
Topic: mysql_fetch_assoc extension
Replies: 10
Views: 5386

Re: mysql_fetch_assoc extension

I've tried that too but the error just changes to:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\...\www\2\core\inc\user.inc.php on line 9
by Porkypie
Sun Jan 06, 2013 12:00 am
Forum: Tutorials
Topic: private message system => can't log in
Replies: 20
Views: 3044

Re: private message system => can't log in

Had another look at my codes but still haven't found the mistake i've made.
I'm not sure where to look for the error either.
So if anyone needs parts of my code to help me out just give a shout and I'll post it ;)
I would be really happy if someone can help me to get the PM system to work :)

Porkypie
by Porkypie
Sat Jan 05, 2013 11:44 pm
Forum: PHP
Topic: mysql_fetch_assoc extension
Replies: 10
Views: 5386

mysql_fetch_assoc extension

Hey, I'm getting the following error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\................www\2\core\inc\user.inc.php on line 9 my code looks like this: [syntax=php]Function fetch_users(){ $result = mysql_query('select `user_id` as `id`, `user_u...