this should work
<?php
include "sql_connect.php";
$text = $_POST['text'];
$test = mysql_query("SELECT * FROM Movies WHERE Mov_ID = '".$text."'");
?>
lyrico
Junior Poster in Training
94 posts since Dec 2010
Reputation Points: 33
Solved Threads: 15
For example:
SELECT * FROM movies WHERE title LIKE 'Ca%'
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
I'd like to throw in an extra bit of advice as well:
sanitizing input: your 'text' variable could inadvertently mess up your record. Use mysql_real_escape_string() about every POST variable, e.g.
$text= mysql_real_escape_string($_POST['text']);
That would be the bare minimum, though. You may also like to look at htmlentities() in addition.
diafol
Rhod Gilbert Fan (ardav)
7,796 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
lyrico
Junior Poster in Training
94 posts since Dec 2010
Reputation Points: 33
Solved Threads: 15