foreach again
Posted: Thu Apr 27, 2006 8:29 pm
I have this snippet of code in my script and when i run the script. it says :"Parse error: parse error, unexpected T_VARIABLE, expecting '(' in /var/www/signup/index.php on line 27" and im pretty sure that i do not need a "(" in there.
Code: Select all
query = "INSERT INTO ftpuser ('userid','passwd','uid','gid','homedir','shell') VALUES ('$uname', '$pass' , '5500' , '5500' ,'/ftp' , '/sbin/nologin')";
$query2 = "INSERT INTO myip ('uname', 'name', 'ip') VALUES ('$uname' ,'$name' ,'$ip')";
//make it run recursivly
$queries = array ("q1" => "$query" ,
"q2" => "$query2" );
foreach $queries as $do {
mysql_query($do);
}