![]() |
Help with my function.
hey, well here is my script
PHP Code:
PHP Code:
why ? Thank you in advance. .Codefreek |
I can test the code since I don't have a database I can test it with now, but some i think you can find out more if you omit the '@' from this line: $res = @mysql_query($sql) or die(mysql_error());
It omits the server from sending an error, if there is any, in the query to the database. |
Don't really think this should be in the advanced section.
Anyhow. Why are you returning false if you don't run a check on it? PHP Code:
So you would probably have to check if the function returned any results, aswell as checking if it returned true or false. |
This is assuming `id` is numerical
PHP Code:
PHP Code:
As to the actual function, have you checked if it's returning false? |
And to add to Enfernikus' message, you don't even SET the $id anywhere, so it's probably NULL.
PHP Code:
PHP Code:
|
code changes..
PHP Code:
|
And.. how do you use the function? :-P
|
when i do $listUsers = readUsers(1); instead of $id
i get back a row, but as suspected only one. :S on var dump, i get string(0); when run on $id |
Is the `id` field unique to the user? If it is, then you will only get one row.
|
<solved><solved>
|
| All times are GMT. The time now is 08:03 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0