Inserting into MySQL question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Tom
Forum Newbie
Posts: 20
Joined: Sat Oct 05, 2002 5:24 pm
Location: Southwest FL

Inserting into MySQL question

Post by Tom »

Hey all,
I was just reading a tutorial on making a news script, when i came across this:

Code: Select all

$query = "INSERT INTO news(title, news, author, date)
VALUES('".$_POSTї'title']."','".$_POSTї'news']."','".$_POSTї'author']."', now())";
mysql_query($query);
What are the $_POST variables? I always see them, but never ever see where they're defined in any scripts.

Are the predefined by PHP or something? If they are, what do they mean?

Later all, - Tom
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

POST

Post by AVATAr »

Post variables are variables that came from a post of a form.

If you have a form that uses de $name variable on it.. after you submit (with the post action) you reach that variable by using $_POST["name"] (you pass the variable from de form to other page)

Look at: sticky...

hope it helps
Post Reply