TheTrav Posted June 5, 2007 Share Posted June 5, 2007 I am making a simple guestbook using php and mysql. This code grabs an image using a database connection - eventually I will be using it as a captcha. Everything works good on my home server running WAMP, but when I upload it to my website nothing will process past the mysqli_connect line (no php, no html, nothing). I asked customer service and mysqli is enabled. Any ideas for a newbie? Thanks in advance. <?php $dbUser = "*****"; $dbIP = "*****"; $dbPwd = "****"; this line works -> echo "test 1234"; $dbConnect = @mysqli_connect($dbIP, $dbUser, $dbPwd) Or die("<p>Unable to connect to the database server.</p>" . "<p>Error Code " . mysqli_connect_errno() . ": " . mysqli_connect_error() . "</p>"); this line doesn't -> echo "test 1234"; $dbName = "TravisH_captcha"; if (!@mysqli_select_db($dbConnect, $dbName)) die("<p>Unable to connect to the database.</p>"); $tableName = "images"; $sqlString = "SELECT * FROM images ORDER BY RAND() LIMIT 1"; $queryResult = @mysqli_query($dbConnect, $sqlString); $row = mysqli_fetch_assoc($queryResult); echo("<input type='text' size='3' maxlength='4' name='imageTextTb'></td><td><img src='{$row['imageLocation']}' class='img' alt='Please enter the text of this image into the text area on the left.' /></td>"); echo("<input type='hidden' name='captcha' value='{$row['imageID']}'>"); mysqli_free_result($queryResult); mysqli_close($dbConnect); ?> Link to comment https://forums.phpfreaks.com/topic/54201-solved-newb-working-on-a-database-problem/ Share on other sites More sharing options...
TheTrav Posted June 5, 2007 Author Share Posted June 5, 2007 Solved - customer support got back to me and notified my that mysqli was in fact disabled. Thanks. Link to comment https://forums.phpfreaks.com/topic/54201-solved-newb-working-on-a-database-problem/#findComment-267980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.