tejama Posted February 15, 2007 Share Posted February 15, 2007 I need some help here folks. I recently setup my hosting plan with GoDaddy (which I'm not happy with at all right now). But in any case, on the comp I developed the code with, I had access to mysqli. With GoDaddy, mysqli is not available. In any case, could anyone explain how I can re-write this code to serve the same function? function db_connect() { $result = new mysqli('mysql295.secureserver.net', 'user', 'pass', 'database'); if (!$result) throw new Exception('Could not connect to database server'); else return $result; } Thanks, Tejama Link to comment https://forums.phpfreaks.com/topic/38653-solved-mysqli/ Share on other sites More sharing options...
papaface Posted February 15, 2007 Share Posted February 15, 2007 function db_connect() { $result = mysql_connect("mysql295.secureserver.net", "user", "pass") or die ("Could not connect to database server" . mysql_error()) ; $select = msql_select_db("database",$result); if ($select) return $select; } Link to comment https://forums.phpfreaks.com/topic/38653-solved-mysqli/#findComment-185559 Share on other sites More sharing options...
tejama Posted February 16, 2007 Author Share Posted February 16, 2007 My first message on this board gets answered correctly within 5 minutes...I'm gonna like this place. Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/38653-solved-mysqli/#findComment-186177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.