Paul Jinks wrote:
Hi - first up, make sure that you're passing clean input. It's worth
learning about security from the start. As you've mentioned below that
you're using PHP, you can do this by making sure $topic has been put
through mysql_real_escape_string() - it's not ideal, but it's better
I'm building a fairly basic php/mySql site but I'm running into
problems due to my total lack of experience. I have a database of
videos - each has a title, transcript, description and one or more
topics. So far I can search the database by topic (using a drop-down
menu), like this:
$result = mysql_query("SELECT title FROM videos WHERE topic1= '$topic'");
while($row = mysql_fetch_array($result))
echo "<br />";
What you'd probably be better doing is having something like this:
printf("<a href='video_display.php?id=%s'>%s</a>", $row["id"],
And changing your query accordingly.
Obviously, you'd need video_display.php to accept GET input in the form
of id= as well.
 It's not a magic bullet in so far as it doesn't stop SQL injection.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php