SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mysql_query("INSERT INTO information (info) VALUES ('$info')")
    or die ("bah");

    see any problems?

  2. #2
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    have you considered a WHERE in the string?

    peace

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Your syntax looks fine. What's the problem?

    Oopps! Now, I see a space between 'die' and ('bah'). You can't have that space there. But, if php is parsing that part of the statement, I think your query is failing. I believe php will skip the second part of the or statement when the first portion is true because you only need one part of an or to be true for the whole thing to be true. If the first part of the or fails, then php goes to the second part to check if it is true.

    Actually, if you are getting a parse error, then none of the above is happening.
    Last edited by 7stud; May 17, 2001 at 21:47.

  4. #4
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx all.. turns out it was a stupid mistake on my behalf.. I just connected to wrong database *smack

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol

  6. #6
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    7stud, I don't think having a space between die and the arguement is going to cause an error. Consider:

    print("Hello World");
    print "Hello World";
    print ("Hello World");

    all should work.

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •