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.
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:
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
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
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);}
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
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;
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)
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 -
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.
10 matches
Mail list logo