The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

different results when query run from php vs phpmyadmin

i run the same mysql query from a php file and phpmyadmin (by echo-ing the query in the php file before it is run and then copy and pasting) and they give different results! the difference is the results should give 2 results or entries from the database. whenever i run it in php, it only gives one of the two results and no errors are reported when running the php. anyone know what might be wrong? any help or suggestions appreciated

that is the code snip from the php where i use that sql . $row[0] gives a number 1. i know there are two results because i inputed them myself directly into the database, and also when i run that exact query with phpmyadmin, it gives me the two results i expect. any help appreciated

That line retrieved the first row from the result set, but you didn't do anything with it. If you don't do it, the pointer into the result set will be at the first row when you start your loop a few lines below.