PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hey for some reason im not getting anything from this... just blank (source from browser= <html><body></body></html>) :/
i was working through this tutorial, but this page didn't come out right. im running through this tutorial http://www.devarticles.com/c/a/MySQL/Bu ... d-MySQL/1/
and im having an enormous amount of trouble.. i have a basic understanding of php and mysql. i have created the database and tables and have inserted the data. as i got to the "products" page which is shown below, i understand most if not all of it, but can't seam to get it to work.. then on the "cart" page which should allow users to add and remove the items from the cart... im totally lost. i can't seam to throw it all together to make a working model can anyone help ? thanks in advance
$cxn = ConnectToDb($dbServer, $dbUser, $dbPass, $dbName) or die(mysql_error());
$result = mysql_query("select * from items order by itemName asc") or die(mysql_error());;
You should get in the habbit of adding or die(myql_error()) because it will give you useful information as to what is going wrong.
You should also avoid the use of @ at this time, because it supresses errors. Consider it a bandaid approach at this point, as it is better to simply solve the root of the problem then hiding it. (cough cough line 6)
Last edited by John Cartwright on Tue Apr 19, 2005 9:17 pm, edited 1 time in total.
hi thank you
well jcart, i added the "or die" to my lines and im still getting nothing at all, so i am assuming it is connecting properly to the database, as i had entered data before in the same fashion. so im not quite sure why this isn't working.. are my opening html, body, and table tags in the correct place?
ok maybe i haven't asked this right.. in my first post, all i am trying to do with create a table to show the data from the database in, using a loop. and i haven't done it correctly. so show would i be able to show myslq data in a table using php/html? thanks
if you aren't getting a blank version of your table row(s) then you very likely are getting zero rows from mysql, or you are dying somewhere, but aren't displaying the errors.
Check what is returned from mysql_num_rows(), as well as checking your error logs on the (web) server.