PHP Error - MYSQL Function
Having some trouble... can't figure it out what is wrong.
<?php
if(isset($_POST['post'])){
if($_POST['title'] || $_POST['text'] || $_POST['text'] > 24){
$title = clean($_POST['title']);
$text = clean($_POST['text']);
$showselect = $_POST['show'];
$sql = "SELECT `id` FROM `show` WHERE `show_title` = '$showselect'";
$query = mysql_query($sql);
while($row = mysql_fetch_assoc($query)){
$sql = "INSERT INTO `blog` (show_id, title, content) VALUES('".$row['id']."', '$title', '$text')";
$query = mysql_query($sql);
if($query == TRUE)
echo "
Your blog post has been successfully added to the database.
";
else
echo "ERROR";
}
}else
echo "
All fields are required and the text must be <b>over</b> 24.
";
}
?>
-
wayfarer -
Thanks
SignatureI build web things, server things. I help build the startup Veenome. | Remote Programming Jobs{{ DiscussionBoard.errors[4411443].message }} -
-
wayfarer -
Thanks
SignatureI build web things, server things. I help build the startup Veenome. | Remote Programming Jobs{{ DiscussionBoard.errors[4411469].message }} -
-
KirkMcD -
Thanks
{{ DiscussionBoard.errors[4413095].message }} -
-
NerdGary -
Thanks
Signature.::NATIVE ANDROID APP CREATOR SOFTWARE ::.<><>-----------------------------------------<><>{{ DiscussionBoard.errors[4497875].message }} -
-
lknielsen -
Thanks
{{ DiscussionBoard.errors[4502500].message }} -
-
leppozdrav -
Thanks
Signaturewww.seorockstars.net{{ DiscussionBoard.errors[4505263].message }} -