ecabrera Posted December 27, 2012 Share Posted December 27, 2012 mysqli_query("INSERT INTO `users` (`email`, `name`, `phone`,`reason`) VALUES ('$email', '$name', '$phone','$reason')"); i get an error everything i run this Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/content/g/html/phomne/index.php on line 12 this is the first time im using mysqli i been using mysql_query Link to comment https://forums.phpfreaks.com/topic/272397-mysqli-query/ Share on other sites More sharing options...
Pikachu2000 Posted December 27, 2012 Share Posted December 27, 2012 The connection resource is the first parameter passed to the function, and is not optional: mysqli_query Link to comment https://forums.phpfreaks.com/topic/272397-mysqli-query/#findComment-1401453 Share on other sites More sharing options...
Christian F. Posted December 27, 2012 Share Posted December 27, 2012 Note that you will need to change all your mysql_* functions into their MySQLi equivalents. It is not possible to mix between the two libraries. Most of the time it's just a question of adding the extra i in the function call, and the connection variable as the first parameter. Though, there are some (subtle) differences, so I highly recommend reading the manual pages for the functions before doing the change. Link to comment https://forums.phpfreaks.com/topic/272397-mysqli-query/#findComment-1401520 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.