Page 1 of 1

building basic blog and getting errors

Posted: Wed Jul 22, 2009 9:57 pm
by taralee02
I went through tutorial on this site...
http://net.tutsplus.com/tutorials/php/h ... ment-83258

It doesn't work for me I get errors.

I get errors…..

Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/a6964267/public_html/Template/SimpleBlog/includes/includes.php on line 20
line 20 is…….
$query = mysqli_query(”SELECT * FROM blog_posts ORDER BY id DESC”);

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /home/a6964267/public_html/Template/SimpleBlog/includes/includes.php on line 24
line 24 isss….
while ($row = mysqli_fetch_assoc($query))

any help or suggestions?

Also another question posted.....link here...
viewtopic.php?f=1&t=103526

Re: building basic blog and getting errors

Posted: Wed Jul 22, 2009 10:58 pm
by superdezign
mysqli_query requires a mysqli object as the first parameter. This means that your variable $query will not be a mysqli_result object since mysqli_query() never successfully executes.

Re: building basic blog and getting errors

Posted: Wed Jul 22, 2009 11:00 pm
by taralee02
hmmmm ok I am tired now, but I will look at code again tomorrow. Thanks! :-)