MySQL and if statement...

chappill

New Member
Messages
74
Reaction score
0
Points
0
PHP:
$spass = rand(000000, 999999);
    $idrand100 = rand(511111, 999999);
 
    $sql = mysql_query("INSERT INTO 'vpcs' ('ID_MEMBER', 'id2', 'IP', 'Pass', 'Text', 'HDD', 'Conn', 'CPU', 'RAM', 'Psupply', 'Cfan', 'os', 'Type', 'Date', 'SPass', 'Reg') VALUES
    ('$idrand100', '$id', '$virtualip', '$virtualpassg', 'Welcome', '15000000', '100', '132', '1', '440', '6', 'Linux', 'virtual', '$now', '$spass', '$owner');") 
    if (!mysql_query($sql,$con))
    {
      die('Error: ' . mysql_error());
    }
Is a very small snippet of code out of one of my pages on my site... Doe some reason its chucking out:
'
Parse error: syntax error, unexpected T_IF in /home/chappill/public_html/Sources/internet.php on line 697'

Line 697 being the if (!mysqlblahblah) line, can anyone help me? I've checked the above few lines for missed " and ; and cant find any =[

Never mind I have sorted that problem, but now theres a new one =[

PHP:
Parse error: syntax error, unexpected '?' in /home/chappill/public_html/Sources/internet.php on line 6110
Line 6110 says:
PHP:
?
Wait never mind a > xD Sorry.
 
Last edited:

VPmase

New Member
Messages
914
Reaction score
0
Points
0
You need a ; after this line - actually you just need to move the ; infront of the " to after the last )


$sql = mysql_query("INSERT INTO 'vpcs' ('ID_MEMBER', 'id2', 'IP', 'Pass', 'Text', 'HDD', 'Conn', 'CPU', 'RAM', 'Psupply', 'Cfan', 'os', 'Type', 'Date', 'SPass', 'Reg') VALUES
('$idrand100', '$id', '$virtualip', '$virtualpassg', 'Welcome', '15000000', '100', '132', '1', '440', '6', 'Linux', 'virtual', '$now', '$spass', '$owner');")





$sql = mysql_query("INSERT INTO 'vpcs' ('ID_MEMBER', 'id2', 'IP', 'Pass', 'Text', 'HDD', 'Conn', 'CPU', 'RAM', 'Psupply', 'Cfan', 'os', 'Type', 'Date', 'SPass', 'Reg') VALUES
('$idrand100', '$id', '$virtualip', '$virtualpassg', 'Welcome', '15000000', '100', '132', '1', '440', '6', 'Linux', 'virtual', '$now', '$spass', '$owner')");
 
Last edited:
Top