MySQL Forums
Forum List  »  PHP

Re: mysql_fetch_array
Posted by: san san htwe
Date: June 21, 2005 08:18AM

//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

Options: ReplyQuote


Subject
Written By
Posted
June 20, 2005 09:35AM
June 20, 2005 10:38AM
June 20, 2005 11:51AM
June 20, 2005 09:10PM
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.