![]() |
Mysql_fetch_array echo only 1 result
Hello, my function echo only 1 result. I want to echo more results with using this function. Can you please help me, thanks!
PHP Code:
|
We need more info.
What is the sql you are using? What is the table structure? How many records have you got in the table? Is the fact its only echoing 1 result due to the fact that there is only 1 row in the table being queried? Or has the sql got a LIMIT statement in it? On another note, @ is evil. Every time you use it a small cute fluffy <insert appropriate animal with adequate cute fluffiness here> dies! For the love god please use braces on control structures, namely the while loop. Same as above applies here. |
Hello, I tried this but it doesnt give any error. By the way if I don't put @, it gives error. And I cant understand why animal die when I use that :)
If I use this it echos more and more PHP Code:
|
What error does it give? I still could do with knowing more about the under lying structure and sql that you are using. this kind of debugging is akin to fumbling around in the dark.
The @ (or error suppression symbol) is evil because it makes debugging your code an absolute nightmare. A better solution is to test the code that may create an error before hand, instead of just hiding the error. Also it may hide errors that are useful to the debug process, its all very well and good when its on live but when you are developing it you need errors to be displayed in order for you to be able to fix them, after all you can't fix what you don't know about. In short there are a number of ways to do it without the '@' evil. Take this example: PHP Code:
This will just hide the fact the query is incorrect and fail silently. However if we take the @ off we get: Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource inPHP Code:
Error produced: Code:
Error in query: Table 'test.categorides' doesn't exist |
I have actually noticed what may be the problem (not had my coffee yet, gimme a break), you arnt appending to $downloadiclink but re assigning the value every iteration, thus only one being returned.
PHP Code:
PHP Code:
|
Thanks a lot, I can't believe that only a dot fixes all my code, lol :D
|
| All times are GMT. The time now is 01:04 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0