View Single Post
Old 03-20-2008, 10:44 AM   #1 (permalink)
marxx
The Contributor
 
marxx's Avatar
 
Join Date: Sep 2007
Location: Finland
Posts: 45
Thanks: 3
marxx is on a distinguished road
Default Does it matter how to code query?

I've seen couble ways ppl to code query but now I just have to ask it from here.

Below is three examples and question is: Does it really matter how to do it?

example 1:
Code:
$query = "SELECT * FROM ´mytable´ WHERE slogan = 'kicksass'";
$do_it = mysql_query($query) or die(mysql_error());

$showme = mysql_fetch_array($do_it);
example 2:
Code:
$query = mysql_query("SELECT * FROM ´mytable´ WHERE slogan = 'kicksass'") or die(mysql_error());

$showme = mysql_fetch_array($query);
example 3: (my fav because can do it in one line)
Code:
$showme = mysql_fetch_array(mysql_query("SELECT * FROM ´mytable´ WHERE slogan = 'kickass'")) or die(mysql_error());
Thanks for all.. =)
Send a message via MSN to marxx
marxx is offline  
Reply With Quote