Open Source Development Tutorials | Newsletter Signup | About Us
Search  

Go Back   Open Source Tutorials Forum > Programming Languages > PHP Development
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-10-2006, 05:36 AM
gearmelon gearmelon is offline
Junior Member
 
Join Date: Jan 2006
Posts: 7 gearmelon is on a distinguished road
Default trouble with mysqli() in PHP 5

I've just had my account moved to a server running PHP 5 and am having some difficulty with the mysqli functions. Here's the message I'm getting:
Quote:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/mydir/public_html/mysite/usr/index.php on line 15


Here are lines 8-15:
PHP Code:
 $dbcnx mysqli_connect('localhost'$_SESSION['db_username'], $_SESSION['db_pass'], $_SESSION['dbname']); 

/* check connection */
if (!$dbcnx) {
   
printf("Connect failed: %s\n"mysqli_connect_error());
   exit();
}
    
$sql "SELECT * FROM `regions` LIMIT 1";
      
$result mysqli_query($dbcnx$sql);
    
$regions mysqli_fetch_array($resultMYSQLI_BOTH); 

I've checked the PHP manual for mysqli_fetch_array() and the above seems to conform to the right syntax. Wouldn't '$result = mysqli_query($dbcnx, $sql);' give the 'mysqli_result' expected, instead of the 'boolean given'? Can anyone see the trouble?
Thanks!
Reply With Quote
  #2  
Old 02-11-2006, 05:09 AM
gearmelon gearmelon is offline
Junior Member
 
Join Date: Jan 2006
Posts: 7 gearmelon is on a distinguished road
Default Update

I've gotten past this warning now but I have much updating to do to get my pages functioning again.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 07:19 AM.


Powered by: vBulletin Version 3.0.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright 2004 - 2006 GrindingGears.com. All Rights Reserved.