ballhogjoni Posted April 24, 2007 Share Posted April 24, 2007 Can you please look over this and tell me if there are any errors with this code if (isset($too_small)) { while($row = mysql_fetch_array($sql)){ mysql_query("INSERT INTO dispo_tooSmall (Name, Phone, Email, Position, State) VALUES (.$row['fname'].$row['lname'].,.$row['areacode'].$row['prefix'].$row['linenumber'].,.$row['email'].,.$row['position'].,.$row['state'].)"); mysql_query("DELETE FROM contactinfo WHERE Email='.$row['email'].'"); } ?> Quote Link to comment Share on other sites More sharing options...
mpharo Posted April 24, 2007 Share Posted April 24, 2007 the code looks fine, the query looks a little wierd though....are you using mysqli? Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted April 24, 2007 Author Share Posted April 24, 2007 just mysql. Dont know if thats the same thing. Quote Link to comment Share on other sites More sharing options...
mpharo Posted April 24, 2007 Share Posted April 24, 2007 if you using just mysql you dont need all those periods in there try this.... mysql_query("INSERT INTO dispo_tooSmall (Name, Phone, Email, Position, State) VALUES ('$row[fname] $row[lname]' , '$row[areacode] $row[prefix] $row[linenumber]' , '$row' , '$row[position]' , '$row[state]')"); Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted April 24, 2007 Author Share Posted April 24, 2007 I am coming up with this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/realfina/public_html/tests/cvlsofttest/leads.php on line 124 Quote Link to comment Share on other sites More sharing options...
mpharo Posted April 24, 2007 Share Posted April 24, 2007 What line is 124, can you post the whole page? Quote Link to comment Share on other sites More sharing options...
only one Posted April 24, 2007 Share Posted April 24, 2007 try this mysql_query("INSERT INTO dispo_tooSmall (`name`, `phone`) VALUES ('$row[fname]','$row[lname]')"); etc.. Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted April 24, 2007 Author Share Posted April 24, 2007 if (isset($too_small)) { while($row = mysql_fetch_array($sql)){ mysql_query("INSERT INTO dispo_tooSmall (Name, Phone, Email, Position, State) VALUES ('$row['fname'] $row['lname']','$row['areacode'] $row['prefix'] $row['linenumber']','$row['email']','$row['position']','$row['state']')"); // line 124 mysql_query("DELETE FROM contactinfo WHERE Email='$row['email']'"); } ?> Quote Link to comment Share on other sites More sharing options...
mpharo Posted April 24, 2007 Share Posted April 24, 2007 I modified the query in the other post after posting, you cant use [''] in a sql statement, just remove those outta there and just do '$var[var]' NOT '$var['var']' Quote Link to comment Share on other sites More sharing options...
robgolding63 Posted April 24, 2007 Share Posted April 24, 2007 It's because you're missing a comma inbetween here: '$row['areacode'] $row['prefix'] Hope that does it! Rob Quote Link to comment Share on other sites More sharing options...
mpharo Posted April 24, 2007 Share Posted April 24, 2007 He wants that in there, cause it will print a space between the variables... Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted April 24, 2007 Author Share Posted April 24, 2007 He wants that in there, cause it will print a space between the variables... Thats correct. Thank You mpharo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.