Need helpp with php forums and MySql

I need help
I am retrieving rows from MySQL table
now what I want is that as rows retrieved with each row and edit button will insert
but i don’t know how to insert
here is my code

<?php require('connect.php'); session_start(); $query="SELECT * FROM project WHERE projectstatus='Open'"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0;$j=1; while ($i < $num) { $projectid=mysql_result($result,$i,"projectid"); $fkey=mysql_result($result,$i,"fkey"); $paying=mysql_result($result,$i,"paying"); $completionmonth=mysql_result($result,$i,"completionmonth"); $completiondate=mysql_result($result,$i,"completiondate"); $personspecify=mysql_result($result,$i,"personspecify"); $projecttitle=mysql_result($result,$i,"projecttitle"); $categories=mysql_result($result,$i,"categories"); $tools=mysql_result($result,$i,"tools"); $shortdescription=mysql_result($result,$i,"shortdescription"); $date=mysql_result($result,$i,"date"); $time=mysql_result($result,$i,"time"); $i++; echo "
".$j."
"; echo "
".$projectid."
"; echo "
".$fkey."
"; echo "
".$paying."
"; echo "
".$completionmonth.'  month  '.$completiondate.'  days  '."
"; echo "
".$personspecify."
"; echo "
".$projecttitle."
"; echo "
".$categories."
"; echo "
".$tools."
"; echo "
".$shortdescription."
"; echo "
".$date."
"; echo "
".$time."
"; echo "
"."
"."
"; // I want to insert edit button here but dont know how echo "------------------------------------------------------------------------"."
"; $j++; } ?>

You need to think about what you’re trying to accomplish…

Creating an EDIT button is simple

[php][/php]

But based on what it looks like you’re trying to do, you’ll need to wrap each row in your loop in a form tag and have that redirect you to an edit page, where you will make the changes to that particular row…

[php]
echo “
”.$j."
";
echo “
”.$projectid."
";
echo “
”.$fkey."
";
echo “
”.$paying."
";
echo “
”.$completionmonth.’  month  ‘.$completiondate.’  days  '."
";
echo “
”.$personspecify."
";
echo “
”.$projecttitle."
";
echo “
”.$categories."
";
echo “
”.$tools."
";
echo “
”.$shortdescription."
";
echo “
”.$date."
";
echo “
”.$time."
";
echo “
”."
"."
";

[/php]

Then on your editpage.php, retrieve the projectid and make all the field editable with a save button.

Sponsor our Newsletter | Privacy Policy | Terms of Service