Connecting To Mysql through php/mysqli

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am getting the gollowing error message:

PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in C:\Apache Group\Apache2\htdocs\PHP\_debug_tmp.php on line 5 PHP Fatal error: Call to undefined function mysqli_quesry() in C:\Apache Group\Apache2\htdocs\PHP\_debug_tmp.php on line 9

With the following code:

1 <?php
2 //in order to connect
3 $conn = mysqli_connect("localhost","root","67568");
4 //inorder to designate database
5 mysqli_select_db("php_example", $conn);
6
7 //creating a table
8 $sql = "CREATE TABLE inventory (id int not null primary key auto_increment, item varchar(75))";
9 $result = mysqli_query($sql, $conn);
10 echo $result;
11 ?>


I am a total noob and am trying to copy this right out of a book (except the mysqli part which i had to struggle through on my own). I am using MySql 4.1.8 and PHP5 on Apache 2.0 server. Any help would be great.
Thank you,
jozef


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux