This is the exact error that I am getting. My goals is to have the users posts all on their page. If i got rid of the $_GET
user id functions then every test user I have will have the same posts on their page.
<?php
$userID = $_GET['user_id'];
$ideas_sql = "SELECT * FROM Ideas ORDER BY id DESC WHERE user_id=$userID";
$query = mysql_query($ideas_sql) or die(mysql_error());
$rsIdeas = mysql_fetch_assoc($query);
do {
?>
<h2><a href = 'edit_post.php?id=<?php echo $rsIdeas['id']; ?>'><?php echo $rsIdeas['name']; ?></a></h2>
<p><?php echo $rsIdeas['keywords']; ?></p>
<p><?php echo $rsIdeas['description']; ?></p> <!-- Have to change the style of the ideas -->
<?php } while ($rsIdeas = mysql_fetch_assoc($query)) ?>
</div>
Notice: Undefined index:
user_id
in/Applications/XAMPP/xamppfiles/htdocs/friend_system/my_ideas.php
on line 108
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_id=
' at line 1