Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Having some trouble... can't figure it out what is wrong.
PHP Error - MYSQL Function
7
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
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.
";
}
?>
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
- wayfarer
- KirkMcD
- NerdGary
- lknielsen
- leppozdrav
Next Topics on Trending Feed
-
7