db connect
Posted: Sat Jun 09, 2007 12:42 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi there
can anyone see why i keep getting this :Object id #2
as my result for connect to a Mysql db.Code: Select all
<?php
$user = "mysql";
$host = "localhost";
$password = "mysql";
$database = "db";
$connection = mysqli_connect($host,$user,$password);
if (!$connection){
echo ("<b>unable to connect to the mysql server at this time</b>");
exit();
}
mysqli_select_db($connection,$database);
if(!mysqli_select_db){
exit("<b>unable to connect to signaturedb</b>");
}
$query = "SELECT user_id FROM user LIMIT 10";
$result = mysqli_query($connection,$query);
print $result;
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]