|
-
May 9th, 2004, 07:44 PM
#1
Thread Starter
Frenzied Member
why does this not work
PHP Code:
<?php
mysql_connect (localhost, user, pass);
mysql_select_db (nz);
?>
<?php
if ($action == "save")
{
$result = mysql_query ("UPDATE DB_Stats_Update Values ('$details')");
?>
<p>
<hr>
<strong><font size="2">THANK YOU<br>
</font>
<?php
} else {
?>
<hr>
<?php
$result = mysql_query ("SELECT details from DB_Stats_Update");
$row = mysql_fetch_array($result);
$details = $row["details"];
?>
<hr>
<form method="POST" action="index.php?action=save">
<textarea rows="5" name="details" cols="34"><?php echo $details; ?>
</textarea>
<br>
<input type="submit" value="save" name="B1"></p>
</form>
<?php
}
?></font>
any ideas??
Last edited by kiwis; May 9th, 2004 at 08:59 PM.
-
May 9th, 2004, 08:56 PM
#2
what errors do you get?
edit: your MySQL query where you're updating something is wrong.. it should be something like:
Code:
UPDATE table SET field='value' WHERE conditions='true'
-
May 9th, 2004, 09:02 PM
#3
Thread Starter
Frenzied Member
Originally posted by kows
what errors do you get?
edit: your MySQL query where you're updating something is wrong.. it should be something like:
Code:
UPDATE table SET field='value' WHERE conditions='true'
Ok I get it to display fine but not to update!! a text box does not use a "value"
-
May 9th, 2004, 10:23 PM
#4
from what you first posted, the new value you want to have is "$details".. you just have to specify what field you are updating, and change 'field' in my code to that.
oh, and by the way, a textbox does have a value.. a textbox's value is whatever the user enters into it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|