Jump to content

flash gordon

Members
  • Posts

    150
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

flash gordon's Achievements

Member

Member (2/5)

0

Reputation

  1. ok. I thought it was for 2 different things: regular sql and for stored procedures. Thanks for all the help. [RESOLVED]
  2. Looks like I'm going to have to do it on the php side, my SQL isn't good enough But how do I know that IF and CASE is ONLY for stored procedures. This link http://dev.mysql.com/doc/refman/5.0/en/if-statement.html doesn't seem to tell me that. Thanks for all the help.
  3. I'm trying to make a update or insert query. It's insert/updates 4 tables of data. However, not all tables must have data. So I could be updating some and inserting into others. but why would SELECT CASE WHEN (10>5) THEN (SELECT (5+1)) ELSE (SELECT (1+1)) END work and not the second one?
  4. everything seems to give me an error SELECT CASE WHEN (10>5) THEN (SELECT (5+1)) ELSE (SELECT (1+1)) END works but this gives an error CASE WHEN (10>5) THEN (SELECT (5+1)) ELSE (SELECT (1+1)) END
  5. that really is my whole query. I'm using MySQL Query Browser to test to get the syntax correct. Here's a screenshot. I'm not trying to make a stored procedure or anything, just a plain ol' query that's a conditional. [attachment deleted by admin]
  6. thank you for the reply. This is the doc page on "IF". http://dev.mysql.com/doc/refman/5.0/en/if-statement.html. How do you interpret that to mean IF(CONDITION, DO_WHEN_TRUE, DO_WHEN_FALSE)? Also, copying and pasting your code still gives me a syntax error. thanks again.
  7. IF (10 > 5) THEN SELECT * FROM contact_chat ELSE SELECT * FROM contact_phone END IF still an error
  8. IF TRUE THEN SELECT * FROM contact_chat; ELSE SELECT * FROM contact_phone; END IF still says there is an error
  9. Apparently I have a syntax error. Can anyone tell me what it is? IF TRUE THEN SELECT * FROM contact_chat ELSE SELECT * FROM contact_phone END IF MySQL Version: MySQL 5.0.75-0ubuntu10.2 via TCP/IP
  10. Thanks zeodragonzord! Yeah, that helps a lot. The main reason I'm was asking is not organization but expandability. I have 6 applications (and that number continues to grow) that all use the same authentication code. It seems most expandable to have the authentication in it's own encapsulated place with each application in its own as well. Thanks again, zeodragonzord.
  11. alrighty. thank you much for the help. cheers [RESOLVED]
  12. thank you. And even though this is deprecated, it's a good thing that the single quotes are automatically escaped? What's the replacement to the deprecated property?
  13. I'm trying to test out my security a bit and I've noticed that php is escaping my single quotes. For instance I enter x' OR 1=1-- in a form and the output it gives me is x\' OR 1=1--. Is there a setting in php or apache that automatically escapes single quotes? cheers.
×
×
  • 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.