Re: [PHP-DB] simple issue

2006-11-22 Thread Chris Carter
Thanks Jeff, As I mentioned, this is just a sample code with username password db name all changed. Thanks for your advice coz I never knew the php db archive is searchable. Jeffrey-2 wrote: You should be aware the the PHP-DB archives are openly available on the web and searchable.

[PHP-DB] simple issue

2006-11-21 Thread Chris Carter
Hi, I am new to PHP, just trying a peace of code to access mySQL database to fetch and show result on web page. But getting errors. Can you help me with this code please. Or if you have a very basic code where in I can do some insertion in the database. -- View this message in context:

Re: [PHP-DB] simple issue

2006-11-21 Thread Chris
Chris Carter wrote: Hi, I am new to PHP, just trying a peace of code to access mySQL database to fetch and show result on web page. But getting errors. Can you help me with this code please. Or if you have a very basic code where in I can do some insertion in the database. There are hundreds

Re: [PHP-DB] simple issue

2006-11-21 Thread John Comerford
You'll have to supply more information a) code sample b) error message Chris Carter wrote: Hi, I am new to PHP, just trying a peace of code to access mySQL database to fetch and show result on web page. But getting errors. Can you help me with this code please. Or if you have a very basic

Re: [PHP-DB] simple issue

2006-11-21 Thread Chris Carter
my code: html body ? $username=chris; $password=carter; $database=chris_phpb1; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM phpbb_banlist; $result=mysql_query($query); if (!$result) {exit(Error in SQL);}

RE: [PHP-DB] simple issue

2006-11-21 Thread Ankur Dave
To: php-db@lists.php.net Subject: Re: [PHP-DB] simple issue my code: html body ? $username=chris; $password=carter; $database=chris_phpb1; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM phpbb_banlist; $result

Re: [PHP-DB] simple issue

2006-11-21 Thread John Comerford
I'm pretty new to this stuff myself but try this: while ($row = $result-fetch_array()) { $compname=$row[CompanyName]; $conname=$row[ContactName]; echo trtd$compname/td; echo td$conname/td/tr; } Chris Carter wrote: my code: html body ? $username=chris; $password=carter;

Re: [PHP-DB] simple issue

2006-11-21 Thread Chris
Chris Carter wrote: my code: html body ? $username=chris; $password=carter; $database=chris_phpb1; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM phpbb_banlist; $result=mysql_query($query); if (!$result)

Re: [PHP-DB] simple issue

2006-11-21 Thread Chris
John Comerford wrote: I'm pretty new to this stuff myself but try this: while ($row = $result-fetch_array()) { $compname=$row[CompanyName]; $conname=$row[ContactName]; echo trtd$compname/td; echo td$conname/td/tr; } $result from mysql_query doesn't return an object, so that won't work -

Re: [PHP-DB] simple issue

2006-11-21 Thread Jeffrey
You should be aware the the PHP-DB archives are openly available on the web and searchable. Assuming you have listed your actual username, password, etc, you should immediately go to your web site and change your password. If possible change also your username and database name. Do it now.