Truz
08-03-2006, 03:42 AM
I know this is a really newbie question but hey what can I say IM A NEWBIE.... anyway I got this IF statement that works with a query that puts data into a table but I’m trying to make that the same query put also info from another query to another table at the same time but I seem to be having problems. Here’s the code:
$sql = "INSERT INTO t_info SET
user='$user',
data1='$data1',
data2='$data2',
from='$fromdate1''$fromdate2''$fromdate3',
to='$todate1''$todate2''$todate3'";
$sql2 = "INSERT INTO t_login SET
user='$user',
pass='$pass'";
if (@mysql_query($sql.$sql2)) {
echo('<p>New User added to Members</p>');
} else {
echo('<p>Error adding new User: ' .
mysql_error() . '</p>');
}
$sql = "INSERT INTO t_info SET
user='$user',
data1='$data1',
data2='$data2',
from='$fromdate1''$fromdate2''$fromdate3',
to='$todate1''$todate2''$todate3'";
$sql2 = "INSERT INTO t_login SET
user='$user',
pass='$pass'";
if (@mysql_query($sql.$sql2)) {
echo('<p>New User added to Members</p>');
} else {
echo('<p>Error adding new User: ' .
mysql_error() . '</p>');
}