Re: mysql_fetch_array
//I've kept a separate file for mysql_connect.php. In this file,
<?php
define('DB_USER','root'); // root is my user name
define('DB_PASSWORD','orchid'); //orchid is my password
define('DB_HOST','localhost'); //my host name is kept localhost
define('DB_NAME','test'); //my database name is test
$dbc=@mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) OR die('Could not connect to the database' . mysql_error());
mysql_select_db(DB_NAME) OR die('Could not select the database' . mysql_error());
?>
//In the other file,
<?php
require_once('../mysql_connect.php');
//here I've changed as your suggestion
if(!$result=mysql_query("select * from abc order by name asc",$dbc)){
echo mysql_error();
}else {
while ($row=mysql_fetch_row($result)){
echo stripslashes($row[1]);
}........
//although I changed function like mysql_num_rows, the same error was displayed
Subject
Written By
Posted
Re: mysql_fetch_array
June 21, 2005 08:18AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.