PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I was tring to link two strings together and then save it into dbf file.
I used "." to integrate the two string it seems work. But when saving the new string into dbf file, only the first string was save.
Please see the code below:
$dbname= realpath("../data/comment.dbf");
$db = dbase_open($dbname, 2);
$string= $HTTP_FORM_VARS["oldComment"].gmstrftime ("%a %d-%b-%y %H:%M:%S %z", time ()). ':<br>' . $HTTP_FORM_VARS["newComment"];
Printf ("The new comment is: %s ", $string);
$def = array($HTTP_FORM_VARS["theme"],$string);
dbase_replace_record($db, $def,($HTTP_FORM_VARS["SelRecNumber"]+1));
dbase_close ($db);
The string is correct when printing out (oldComment + Time+ newComment). But in the dbf record only 'oldcomment' was saved.
Any idea why this is happening?
Thanks
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
If you're not sure what to do with the data it outputs just post here. (as long as the form doesn't give out any information you prefer not to give out.)