FloridaNutz Posted August 19, 2006 Share Posted August 19, 2006 I will edit this better after I get a response...I'm creating a basic contact database and i'm having trouble with an option I'm trying implement. On the page that lists the mySQL table, I'm trying to find a way to transfer information of which entry it's at so I can edit that entry by using a image.png and link... ...or am I just crazy and my brain is fried from looking through all these books and forums?Example:List.php edit.php1 Entry :)2 Entry :) / 4 Entry being edited3 Entry :) /4 Entry :o <user clicks this image /5 Entry :) Quote Link to comment Share on other sites More sharing options...
FloridaNutz Posted August 19, 2006 Author Share Posted August 19, 2006 i'm an idiot and my brain is fried.... $_post[variable] Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 19, 2006 Share Posted August 19, 2006 Actually, if you're clicking a link then the variable would be in the $_GET array[code]<a href='edit.php?id=4><img src="editme.gif" ...></a>[/code]And edit.php begins:[code]<?php$id = $_GET['id'];...[/code] Quote Link to comment Share on other sites More sharing options...
FloridaNutz Posted August 19, 2006 Author Share Posted August 19, 2006 OK, I thought it was something like that but i didn't know how to do that in the loop I was making...[code]$result = @mysql_query($sql, $connection) or die(mysql_error());while ($row = mysql_fetch_array($result)) { $UCF_id = $row['UCF_id']; $barName = stripslashes($row['barName']); ...... $edit = '<a href="edit_bar_basic.php"><img src="../images/edit.png" width="16" height="16" border="0"></a>'; ......$display_block .= "<p><strong>$barName:</strong> $barAddress, $barCity $barZip<br> Phone: $barPhone VIP Line: $barVIP $view $edit $delete </p><br>"; }[/code]... I tried doing[code]$edit = '<a href="edit_bar_basic.php?"$UCF_id"">[/code]...but that is obviously wrong... (ucf_id is my id for each entry) Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 19, 2006 Share Posted August 19, 2006 [code]$edit = '<a href="edit_bar_basic.php?id='. $UCF_id. '"><img src=" ....[/code] Quote Link to comment Share on other sites More sharing options...
FloridaNutz Posted August 19, 2006 Author Share Posted August 19, 2006 Thank you for the quick reply! I must have missed that lesson on the periods lol. Thank you! Just let you know, I am teaching myself PHP in two days lol! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.