You are here: Re: No results populating from SQL Query « All PHP « IT news, forums, messages
Re: No results populating from SQL Query

Posted by robert on 05/18/06 01:36

<c.wrinn@gmail.com> wrote in message
news:1147902579.674272.10610@j33g2000cwa.googlegroups.com...
| First, here is my current script:
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| <html>
| <head>
|
| </head>
| <body>
|
| <?
| $mysql = mysql_connect("localhost","cwrinn","cw5324") or die('Unable
| to Authenticate to ODBC'.mysql_error());
| mysql_select_db(snapon_dev, $mysql) or die('Error Selecting
| Database'.mysql_error());
| $result = mysql_query("select * from branch limit 0,30", $mysql) or
| die('Error querying database'.mysql_error());
|
| while ($row = mysql_fetch_row($result))
| {
| for ($i=0; $i<mysql_num_fields($result); $i++)
| echo $row[$i] . " ";
|
| echo "\n";
| }
| mysql_close($connection);
| ?>
| </body>
| </html>
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| What's happenning? Nothing, no error, no display, nothing.

and you've run "select * from branch limit 0, 30" in a query browser and
gotten results back? have you tried adding "print_r($row);" within your
while statement?

btw, NEVER put a calculation in the condition of a FOR statment IF THAT
CALCULATION DOES/WILL NOT CHANGE...otherwise, you are being HIGHLY
inefficient which translates to SLOW scripts!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация