Jump to content


Photo

Do You HAVE To Split MySQL Querys Into 2 Lines?


  • Please log in to reply
2 replies to this topic

#1 jhale1966

jhale1966
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 01 July 2003 - 01:27 PM

I was just wondering what the difference was between:

$query = \"SELECT * FROM [tablename] WHERE [whatever]=[whatever]\";
$result = mysql_query($query);

and

$result = mysql_query(\"SELECT * FROM [tablename] WHERE [whatever]=[whatever]\");

Is it just better programming practice to split them up? I\'m still very new to this and would like to start off on the right foot.

Thanks! :)

#2 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts
  • LocationMassachusetts

Posted 02 July 2003 - 03:41 AM

i think it\'s easier debugging to split it, especially if you have a REALLY long query

#3 jhale1966

jhale1966
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 02 July 2003 - 07:07 PM

Gotcha!

So it\'s best that I go ahead and keep doing it for consistancy. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users