| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Senior Member | Whats wrong with this? (searching database for specific id) This is the code which im having problems with (its not all the code, so i am not missing the <?php, or a }) Code: $sql_query = "SELECT * FROM links WHERE id='$id'";
//store the SQL query in the result variable
$result = mysql_query($sql_query);
if(mysql_num_rows($result))
{
//output as long as there are still available fields
while($row = mysql_fetch_array($result))
{
$title = $row["title"];
$url = $row["url"];
$id = $row["id"];
$status = $row["status"];
$email = $row["email"];
}
Im trying to get it to let you edit the information in the 'links' part of the database. The page before has this code: Code: <a href=\"editlink.php?id=$id\">Edit</a> |
| |
| | #3 (permalink) |
| NamePros Regular | aren't you forgetting to get the id from the link? try this query PHP Code: PHP Code: |
| |
| | #4 (permalink) | |
| Senior Member | Quote:
Haha, thanks slewey, i knew it was something to do with that line. Rep added. I see the rep also got you another green bar | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |