•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,560 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,470 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 518 | Replies: 1 | Solved
![]() |
•
•
Join Date: Oct 2007
Posts: 37
Reputation:
Rep Power: 2
Solved Threads: 0
Not sure if this is a PHP or a MySQL problem...I am pretty new at both. Basically I have a .php form that is writing data to the db just fine and most of the data is saving back to the .php file fine. I have several "text" boxes that I am using varchar...as well as some using "text" and int for the db. Anyway...when I got to using "textarea" it fails. Here is a little code from both the _db.php and the .php. Any help would be much appreciated.
From the DB:
From the .php:
Thanks
DS
From the DB:
$EXT = $_POST[EXT];
$Collab = $_POST[Collab];
$WSR = $_POST[WSR];
$AWIPS = $_POST[AWIPS];
$Other = $_POST[Other];
$Misc = $_POST[Misc];
$Backup = $_POST[Backup];
$dateString = $year."-".$month."-".$day;
$dbhost=$_SERVER['DB_HOST'];
$strConn=@mysql_connect($dbhost,"*******","*******");
mysql_select_db("shift_duties",$strConn);
$table="A_shift_duties";
mysql_query("UPDATE $table SET `month`='$month',`day`='$day',`year`='$year',`LT`='$LT',`ST`='$ST',`HMT`='$HMT',`Sick`='$Sick',`Annual`='$Annual',`Comp`='$Comp',`OT`='$OT',`AFD`='$AFD',`CCF`='$CCF',`ZFP`='$ZFP',`ZON`='$ZON',`PFM`='$PFM',`AFM`='$AFM',`HWO`='$HWO',`FWF`='$FWF',`FWL`='$FWL',`RFI`='$RFI',`RFD`='$RFD',`WXStory`='$WXStory',`RWSKS`='$RWSKS',`SendNDFD`='$SendNDFD',`EXT`='$EXT',`Collab`='$Collab',`WSR`='$WSR',`AWIPS`='$AWIPS',`Other`='$Other',`Misc`='$Misc',`Backup`='$Backup' WHERE `date`='$dateString'") or die (mysql_error());
?>
From the .php:
if($row['Collab'] == ""){
echo"<td width='794' bgcolor='#C0C0C0'><p>Collaboration:</p><p><textarea name='Collab' cols='69' rows='5' wrap='physical'></textarea></p></td>";
}else{
$Collab[$i] = $row['Collab'];
echo"<td width='794' bgcolor='#C0C0C0'><p>Collaboration:</p><p><textarea name='Collab' cols='69' rows='5' wrap='physical' value='.$Collab[$i].'></textarea></p></td>";
}Thanks
DS
first: put in this form
$EXT = $_POST['EXT'];
or why dont you use form post method if you are new to this?
$dbhost=$_SERVER['DB_HOST']; =>
$dbbost= "locahost"; #or 127.0.0.1
here what if you same dates on your db...
your record will be involved... track the ID
WHERE `date`='$dateString'")
and if you are trying to post ur sql script before assing the values to those variables.. it will return "ZERO"
u cannot add anyting to textarea like this
' rows='5' wrap='physical' value='.$Collab[$i].'></textarea><
----
<textarea name='Collab' cols='69' rows='5' wrap='physical'> <?php print $Collab[$i] ?>
</textarea>
$EXT = $_POST['EXT'];
or why dont you use form post method if you are new to this?
$dbhost=$_SERVER['DB_HOST']; =>
$dbbost= "locahost"; #or 127.0.0.1
here what if you same dates on your db...
your record will be involved... track the ID
WHERE `date`='$dateString'")
and if you are trying to post ur sql script before assing the values to those variables.. it will return "ZERO"
u cannot add anyting to textarea like this
' rows='5' wrap='physical' value='.$Collab[$i].'></textarea><
----
<textarea name='Collab' cols='69' rows='5' wrap='physical'> <?php print $Collab[$i] ?>
</textarea>
Do a favour, leave me alone
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- powerbuilder+mysql (MySQL)
- Help With Messages in Mysql Stop Overwriting (MySQL)
- Error message while importing data to Excel from the MySQL db (MySQL)
- Got a serious problem here.... (Troubleshooting Dead Machines)
- Script stores data in wrong MySQL columns (MySQL)
- Data Structure Problem (C)
- Possible Data Lost, Help! (Windows 9x / Me)
- Back button problem with $Sessions and GET (PHP)
Other Threads in the PHP Forum
- Previous Thread: To retrieve the array value in javascript
- Next Thread: Senior Web Developer Position


Linear Mode