Welcome to WebmasterWorld Guest from 54.196.244.206

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Form Row ID

form method post

     
12:26 pm on Jun 9, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:July 24, 2009
posts: 113
votes: 0


hi,

i'm unable to retrieve value of row id when clicking the submit button. The id was completely empty.
Could some one brief me on these issue?
Thanks



while($row = mysql_fetch_row ($result))
{
echo "<tr>";

// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td class='td_rowhd'><font class=tdrow>$cell</font></td>";

echo "<td class='td_rowhd'><form method='POST' action='update.php?id=".$row['id'] . "'>
<input type='submit' value='Update Changes'></td>";

1:33 pm on June 9, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:July 24, 2009
posts:113
votes: 0


anyone?
2:12 pm on June 9, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Feb 22, 2009
posts:1396
votes: 0


Hi there Chrissim,

I am curios as to why you are looping within a loop..

What are you trying to achieve? Because it looks like you want to grab data, edit, then update records according to the id number pulled in the first place...

First place to start is by turning on error_reporting to see what if any errors are being flagged:-

<?php
error_reporting(E_ALL);
//rest of code
.
.

then trace each step as you get the data by echoing and exiting :)

Cheers,
MRb
4:53 am on June 10, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:July 24, 2009
posts:113
votes: 0


Hey thanks matthew1980, everything working now :)
7:10 am on June 10, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Feb 22, 2009
posts:1396
votes: 0


Hi there chrissim,

What'd I do? I assume there was a typo in the mix somewhere?

Cheers,
MRb