Jump to content

moxicon

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.moxleystratton.com
  • ICQ
    83270020

Profile Information

  • Gender
    Not Telling
  • Location
    Portland, Oregon, USA

moxicon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. '||' is a boolean operator, and it always results in either true or false. So in your example above, $result would become TRUE instead of being a query result (as long as the query was valid, in which case die() would be called). The 'OR' operator always returns the value of the first operand, and it will evaluate operands until it either finds one that can resolve to TRUE, or it runs out of operands. Sound confusing? It is. Maybe this example will help: $result = "0" || 0 || false || "hello"; // $result becomes TRUE $result = "0" OR 0 OR false OR "hello" ; $result becomes "0" Just don't use '||' to do what you're trying to do.
  2. "printf" hinted at something very important that needs to be addressed. You MUST escape the values that get inserted into your query string. In this case, mysql_real_escape_string(). Whithout doing so, you may be opening your script up to SQL Injection attacks at worst, or a sometimes failing query at best. Please do not save this step for later.
  3. Functions don't work inside HEREDOCs. Also, the curly braces are unnecessary in your example.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.