MySQL Forums
Forum List  »  Quality Assurance

Updating Array PLease HELP ME
Posted by: Diaa Bendary
Date: May 30, 2008 02:21PM

Please I need Help . I want to update array in the database separated by ","
I exploded it and show the results by $test[0] , $test[1] , $test[2] . in the smarty desgin because each part should be apear alone .
This is the code for inserting in the data base ;
function appreg($name, $email, $pass, $test){
$test = utility::input_array($test);
// 'utility' is another function which i exploded
$sql = "INSERT INTO `thistable` ( `id` , `name` , `email` , `pass` ,`test`) VALUES (NULL , '$name', '$email', MD5('$pass'), '$test) ";
if(mysql_query($sql) == true)return true;else return false;

Then I exploeded in another function by this way .
$r[test] = explode(",", $row[test]);
I show the results correctly . ans separated as i want .But when i trying to update it by the following way . there is nothing updated .

function modify_userdata($name,$email,$test){
There is a condiotion and the first 2 variabled updated without ant problem because not arrays but $test is array then the sql
$sql = "UPDATE `{thistable}` SET `name` = '{$name}',`email` = '{$email}',`test` = '{$test} WHERE `id` = $userid ;";

So if any one know to fix this problem please help

Options: ReplyQuote


Subject
Views
Written By
Posted
Updating Array PLease HELP ME
2709
May 30, 2008 02:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.