1
DarkDeath
PH Help....MySQL Help too lol
  • 2003/10/18 17:10

  • DarkDeath

  • Just popping in

  • Posts: 29

  • Since: 2002/8/17


Working on a form to Update exiting entries in a table.... really wracking my brain cause im using a form with the values set to the existing tables.. and all that works... its the output of the form and the update that im having a problem with.... The output variables arent transfering to my update query.... well heres the code...


Here is the FORM...this is PART of the whole file.... this part all works.. its the action thats not..
{
$edit .= "<FORM action="http://www.thisgeneration.com/modules/cjaycontent/content/encounters_form_update.php" method="POST">
<input type="hidden" name="id" value="$row[id]">
<
input type="hidden" name="redirect" value="http://www.thisgeneration.com/modules/cjaycontent/index.php?id=29">
<
table>
<
tr><td align="right">Script Title: </td><td><input type="text" name="script_title" value="$row[script_title]size="52"></td></tr>
<
tr><td align="right">Script: </td><td><input type="text" name="script" value="$row[script]size="52"></td></tr>
<
tr><td align="right">Content Title: </td><td><input type="text" name="content_title" value="$row[content_title]size="52"></td></tr>
<
tr><td align="right" valign="top">Content: </td><td><textarea name="content" rows="20" cols="52">$row[content]</textarea></td></tr>
</
table>

<
input type="submit" name="submit" value="submit"> <input type="reset" value="reset">
</
FORM>";


}
?>


Here is the file set to the Forms Action... its my POST variable that arent working write... its updating and everything.. but its updating to {$_POSTBLAHBLAH and not the ACTUAL content..

<?php
$dbname 
"thisgene_sitearticles";            // Place the database name here
$tablename "encounters";                // Table name here

$dbconnect mysql_connect ("localhost""thisgene_porter""102073") or die(mysql_error());

$db = @mysql_select_db($dbname$dbconnect);


$sql 'UPDATE `encounters` SET `script_title` = '{$_POST[script_title]}',';
$sql .= ' `script` = '{$_POST[script]}',';
$sql .= ' `content_title` = '{$_POST[content_title]}',';
$sql .= ' `content` = '{$_POST[content]}' WHERE `id` = '11' LIMIT 1 ;';
$sql .= ''




$result = @mysql_query($sql$dbconnect) or die(mysql_error());

echo 
"Entry Updated  |  Click <a href=http://www.thisgeneration.com/modules/cjaycontent/index.php?id=27>HERE</a> to return to the Menu."

?>



PLEASE help lol

2
Mithrandir
Re: PH Help....MySQL Help too lol

Try this:

$sql "UPDATE `encounters` SET `script_title` = '".$_POST['script_title']."',";
$sql .= " `script` = '".$_POST['script']."',";
$sql .= " `content_title` = '".$_POST['content_title']."',";
$sql .= " `content` = '".$_POST[content]."' WHERE `id` = '11' LIMIT 1;";
$sql .= "";

3
DarkDeath
Re: PH Help....MySQL Help too lol
  • 2003/10/18 19:56

  • DarkDeath

  • Just popping in

  • Posts: 29

  • Since: 2002/8/17


THASNK!

Login

Who's Online

246 user(s) are online (157 user(s) are browsing Support Forums)


Members: 0


Guests: 246


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits