MySQL Forums
Forum List  »  PHP

Re: Trying to link php and mySQL!!
Posted by: Andrei Tudor
Date: December 10, 2005 05:20PM

1 => Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\test_insert_sql.php on line 7

In PHP 5 mysql library is not included in the core. Instead, you have to add it because it is an extension. You should modify your PHP.INI file:

extension_dir = <extension_dir_path> (Ex: extension_dir = "D:\php\ext")

somwehere you will find ";extension=php_mysql.dll". Replace it with: extension=php_mysql.dll




2 => Parse error: parse error, unexpected '>' in C:\Program Files\Apache Group\Apache2\htdocs\test_select_sql.php on line 22

Try smth like that:

while ($row = mysql_fetch_object ($result)) {
$text = $row->text;
echo ("\n$text <br>");
}

or

while ($row = mysql_fetc_object ($result)) {
echo ("($row->text)<br>");
}



Enjoy

Options: ReplyQuote


Subject
Written By
Posted
December 09, 2005 04:05PM
Re: Trying to link php and mySQL!!
December 10, 2005 05:20PM


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.