Parse error on code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sparkie951
Forum Newbie
Posts: 1
Joined: Wed Nov 16, 2011 9:44 am

Parse error on code

Post by sparkie951 »

Getting a parse error on line 11. I don't see the error. Any assistance woul be appreaciated.

Sparkie

Code: Select all


<?php require_once 'reader.php'; [syntax=php]
$data = new Spreadsheet_Excel_Reader(); $data->setOutputEncoding('CP1251'); $data->read('c:\www\test.xlsx');

$conn = mysql_connect("hostname"," username",""); mysql_select_db("list",$conn);

for ($x = 2; $x < = count($data->sheets[0]["cells"]); $x++) { $name = $data->sheets[0]["cells"][$x][1]; $extension = $data->sheets[0]["cells"][$x][ 2]; $email = $data->sheets[0]["cells"][$x][3]; $sql = "INSERT INTO test (name,extension,email) VALUES ('$name',$extension,'$email')"; echo $sql."\n"; mysql_query($sql); }

?>
[/syntax]
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Parse error on code

Post by Celauran »

You have an extra space; < = when it should be <=
Post Reply