New Posts  All Forums:Forum Nav:

More PHP/MySQL Help!

post #1 of 9
Thread Starter 
Code:
Parse error: parse error, unexpected ')' in /homepages/19/d187758345/htdocs/root/phpBB3/insert.php on line 61/[BOLD LINE I HIGHLIGHTED]
Code:
if($mode="add")
 { 
$number = $_POST['number'];  
$name = $_POST['name'];
$skillset = $_POST['skillset'];
$initgroup = $_POST['initgroup'];
$memberA = $_POST['memberA'];
$memberB = $_POST['memberB'];
$memberC = $_POST['memberC'];  

$sql = "INSERT INTO teams (numb, name, skill, grp, memberA, memberB, memberC)
VALUES ('$number', '$name', '$skillset', '$initgroup', '$memberA', '$memberB', '$memberC')");
    }
I have removed it and I get T_ENCAPSED_AND_WHITESPACE as an error. I am almost 100% done with my PHP app and this is the only thing stopping me.
post #2 of 9
It is probably complaining about the unexpected ')' after your sql statement.
Main Rig
(15 items)
 
  
Reply
Main Rig
(15 items)
 
  
Reply
post #3 of 9
Thread Starter 
Quote:
Originally Posted by BFRD View Post
It is probably complaining about the unexpected ')' after your sql statement.
Code:
'$memberC')");
I removed it and got "T_ENCAPSED_AND_WHITESPACE" error on the line.
post #4 of 9
Change to:
Code:
$sql = "INSERT INTO teams (numb, name, skill, grp, memberA, memberB, memberC)
VALUES ('$number', '$name', '$skillset', '$initgroup', '$memberA', '$memberB', '$memberC')";
Edit: Realize this is not a SQL error, but a parse error. Because of this, you know that the error can't be within your SQL query, but around it, unless there is an issue with quotation marks (Actually, I think that might even give a SQL error... )
post #5 of 9
Quote:
Originally Posted by BFRD View Post
It is probably complaining about the unexpected ')' after your sql statement.
$memberB', '$memberC')");

Whats that doing there ?
Craiginator
(13 items)
 
  
CPUMotherboardGraphicsRAM
e6420 - L712a517 Abit AB9 Pro P965 XFX 7800 GTX 2GB GEIL PC2-8500 Ultra 
Hard DriveOptical DriveOSMonitor
2x Wd 160gb Raid 0 Asus Dvd/Cd-RW Ubuntu / XPlite 22' Acer ws X222W 
KeyboardPowerCaseMouse
G15 Antec 550 True Power Antec 900 G5 
Mouse Pad
Yes Please. 
  hide details  
Reply
Craiginator
(13 items)
 
  
CPUMotherboardGraphicsRAM
e6420 - L712a517 Abit AB9 Pro P965 XFX 7800 GTX 2GB GEIL PC2-8500 Ultra 
Hard DriveOptical DriveOSMonitor
2x Wd 160gb Raid 0 Asus Dvd/Cd-RW Ubuntu / XPlite 22' Acer ws X222W 
KeyboardPowerCaseMouse
G15 Antec 550 True Power Antec 900 G5 
Mouse Pad
Yes Please. 
  hide details  
Reply
post #6 of 9
Quote:
Originally Posted by LyokoHaCk View Post
Code:
'$memberC')");
I removed it and got "T_ENCAPSED_AND_WHITESPACE" error on the line.
That is the real error. The ')' only prevents that one because it is caught first.
Main Rig
(15 items)
 
  
Reply
Main Rig
(15 items)
 
  
Reply
post #7 of 9
Thread Starter 
Quote:
Originally Posted by version2 View Post
Change to:
Code:
$sql = "INSERT INTO teams (numb, name, skill, grp, memberA, memberB, memberC)
VALUES ('$number', '$name', '$skillset', '$initgroup', '$memberA', '$memberB', '$memberC')";
Edit: Realize this is not a SQL error, but a parse error. Because of this, you know that the error can't be within your SQL query, but around it, unless there is an issue with quotation marks (Actually, I think that might even give a SQL error... )
That fixed it.
!
Thanks everyone!
post #8 of 9
What else did you change? Unless I am blind, the only thing different there is taking out the ')' at the end. Didn't you say you tried that earlier. Granted I was never any good at the "spot the differences between these two pictures" either.
Main Rig
(15 items)
 
  
Reply
Main Rig
(15 items)
 
  
Reply
post #9 of 9
Thread Starter 
I have no idea I might have taken out the wrong ).
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding