Jump to content

mysql_query hack


Caps

Recommended Posts

Is it allowed to have more than one SQL statements (SELECT and DELETE) in one mysql_query() method? Or must you have two mysql_query methods to it?

If the user posts something you want to set into your database, will they could finished the insert statement and execute a drop and delete statement in the same mysql_query method?

Like:
site.php?id = ....
$id = "'; DELETE FROM users WHERE id = 1" //user changed variable
mysql_query("SELECT navn FROM users WHERE id = '$id'")

The above code does not work, but I hope you got the idea of it. Is it possible in any way?
Link to comment
Share on other sites

[quote author=thorpe link=topic=110490.msg446801#msg446801 date=1159985951]
I believe mysql5 may handle multiple queries seperated by colons.[/quote]
As far as I know, there is no difference how mysql_query() behaves depending on the MySQL version. One query is allowed, not more.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.