Re: [PHP-DB] Parse error
There are further problems with the mySQL query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND CURDATE() <= DATE(FROM_UNIXTIME(1239508800)), 1, 0), IF(CURDATE() >= DATE' This is the whole query, what am I missing / doing wrong? SELECT GREATEST( IF(CURDATE() >= DATE_SUB(CONCAT(DATE(FROM_UNIXTIME(1239508800)), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1)) DAY) AND CURDATE() <= DATE(FROM_UNIXTIME(1239508800)), 1, 0), IF(CURDATE() >= DATE_SUB(CONCAT(YEAR(CURDATE()), '-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAY) AND CURDATE() <= YEAR(CURDATE()), '-12-25'), 2, 0) ) AS verse_application On Thu, 2009-09-24 at 15:39 +1000, Chris wrote: > Ron Piggott wrote: > > Let me try this is a different way. > > > > What is the variable which I am able to retrieve? I am expecting the > > result to be a 0, 1 or 2. > > Your original problem was getting a parse error. > > Your query is not php code - step 1 is to fix that. > > Once you've done that, post the new code and new problem you're having. > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error
Ron Piggott wrote: Let me try this is a different way. What is the variable which I am able to retrieve? I am expecting the result to be a 0, 1 or 2. Your original problem was getting a parse error. Your query is not php code - step 1 is to fix that. Once you've done that, post the new code and new problem you're having. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error
Ron Piggott wrote: This is the actual code. What should I have? Same as when you do a query normally. $query = "SELECT ... WHERE "; $result = mysql_query($query); . On Thu, 2009-09-24 at 13:20 +1000, Chris wrote: Ron Piggott wrote: The following code gives me this error message: Parse error: syntax error, unexpected ':' in /home/thev4173/public_html/test.php on line 8 It is referencing the : that follows EasterDate (and will eventually get mad at ChristmasDate) mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); IF(CURDATE() >= DATE_SUB(CONCAT(@EasterDate := DATE(FROM_UNIXTIME(easter_date(date('Y'))), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1)) DAYS) AND CURDATE() <= @EasterDate, 1, 0) IF(CURDATE() >= DATE_SUB(CONCAT(@ChristmasDate := YEAR(CURDATE()), '-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAYS) AND CURDATE() <= @ChristmasDate, 2, 0) mysql_close(); What is the problem? If this is your actual code, the queries aren't in php variables. $query = "IF(curdate() "; -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error
Ron Piggott wrote: The following code gives me this error message: Parse error: syntax error, unexpected ':' in /home/thev4173/public_html/test.php on line 8 It is referencing the : that follows EasterDate (and will eventually get mad at ChristmasDate) mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); IF(CURDATE() >= DATE_SUB(CONCAT(@EasterDate := DATE(FROM_UNIXTIME(easter_date(date('Y'))), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1)) DAYS) AND CURDATE() <= @EasterDate, 1, 0) IF(CURDATE() >= DATE_SUB(CONCAT(@ChristmasDate := YEAR(CURDATE()), '-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAYS) AND CURDATE() <= @ChristmasDate, 2, 0) mysql_close(); What is the problem? If this is your actual code, the queries aren't in php variables. $query = "IF(curdate() "; -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error
The following code gives me this error message: Parse error: syntax error, unexpected ':' in /home/thev4173/public_html/test.php on line 8 It is referencing the : that follows EasterDate (and will eventually get mad at ChristmasDate) mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); IF(CURDATE() >= DATE_SUB(CONCAT(@EasterDate := DATE(FROM_UNIXTIME(easter_date(date('Y'))), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 1)) DAYS) AND CURDATE() <= @EasterDate, 1, 0) IF(CURDATE() >= DATE_SUB(CONCAT(@ChristmasDate := YEAR(CURDATE()), '-12-25'), INTERVAL LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use = 2)) DAYS) AND CURDATE() <= @ChristmasDate, 2, 0) mysql_close(); What is the problem? And what is the variable that has the value of 0, 1 or 2? Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error: syntax error, unexpected '>' in C:\wamp\www\new.php on line 38
WOW, Both of your suggestions worked like magic. Thanks a lot Patrick -Sashi Patrick Price wrote: I believe your problem is that on line 33 you forgot your closing double quote in the echo statement. Thanks patrick Sent from: Decatur Ga United States. On Fri, Feb 13, 2009 at 10:02 PM, Sashikanth Gurram wrote: Hi all, I have pasted the PHP code I wrote below. I do not know why, but I am getting the parse error: unexpected '>'. It says the error is on line 38. The exact line on line 38 is * echo"\n* Basically, I am trying to execute an sql query through PHP which tries to extract data from the mysql database and display the data in the browser. The query is running fine but I am getting the problems when I try to display the data in the browser. Can anyone help me with it? Thanks, Sashi "; echo "OCCUPANCY"; echo ""; echo "; while ($row=mysqli_fetch_array($data)) { extract($row); echo"\n $building\n $parking_lot\n $month\n $day\n $occupancy\n $empty_spaces\n $special_days\n \n"; echo "\n"; } echo"\n"; ?> -- ~ ~ Sashikanth Gurram Graduate Research Assistant Department of Civil and Environmental Engineering Virginia Tech Blacksburg, VA 24060, USA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- ~ ~ Sashikanth Gurram Graduate Research Assistant Department of Civil and Environmental Engineering Virginia Tech Blacksburg, VA 24060, USA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error: syntax error, unexpected '>' in C:\wamp\www\new.php on line 38
I believe your problem is that on line 33 you forgot your closing double quote in the echo statement. Thanks patrick Sent from: Decatur Ga United States. On Fri, Feb 13, 2009 at 10:02 PM, Sashikanth Gurram wrote: > Hi all, > > I have pasted the PHP code I wrote below. I do not know why, but I am > getting the parse error: unexpected '>'. It says the error is on line 38. > The exact line on line 38 is > * echo"\n* > > Basically, I am trying to execute an sql query through PHP which tries to > extract data from the mysql database and display the data in the browser. > The query is running fine but I am getting the problems when I try to > display the data in the browser. > > Can anyone help me with it? > > Thanks, > Sashi > > /* CONNECTS TO THE DATABASE*/ > $host="**"; > $user="**"; > $password="***"; > $dbname="*"; > $cxn=mysqli_connect($host, $user, $password, $dbname); > if (!$cxn=mysqli_connect($host, $user, $password, $dbname)) > { > $error=mysqli_error($cxn); > echo "$error"; > die(); > } > else > { > echo "Connection established successfully"; > } > $sql="select * FROM OCCUPANCY"; > $data=mysqli_query($cxn,$sql); > if (!$data=mysqli_query($cxn,$sql)) > { > $error=mysqli_error($cxn); > echo "$error"; > die(); > } > else > { > echo "Query sent successfully"; > } > echo ""; > echo "OCCUPANCY"; > echo ""; > echo "; > while ($row=mysqli_fetch_array($data)) > { > extract($row); > echo"\n >$building\n >$parking_lot\n >$month\n >$day\n >$occupancy\n >$empty_spaces\n >$special_days\n >\n"; > echo "\n"; > } > echo"\n"; > ?> > > -- > ~ > ~ > Sashikanth Gurram > Graduate Research Assistant > Department of Civil and Environmental Engineering > Virginia Tech > Blacksburg, VA 24060, USA > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP-DB] Parse error: syntax error, unexpected '>' in C:\wamp\www\new.php on line 38
Hi all, I have pasted the PHP code I wrote below. I do not know why, but I am getting the parse error: unexpected '>'. It says the error is on line 38. The exact line on line 38 is * echo"\n* Basically, I am trying to execute an sql query through PHP which tries to extract data from the mysql database and display the data in the browser. The query is running fine but I am getting the problems when I try to display the data in the browser. Can anyone help me with it? Thanks, Sashi "; echo "OCCUPANCY"; echo ""; echo "; while ($row=mysqli_fetch_array($data)) { extract($row); echo"\n $building\n $parking_lot\n $month\n $day\n $occupancy\n $empty_spaces\n $special_days\n \n"; echo "\n"; } echo"\n"; ?> -- ~ ~ Sashikanth Gurram Graduate Research Assistant Department of Civil and Environmental Engineering Virginia Tech Blacksburg, VA 24060, USA -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE
On Tue, Apr 15, 2008 at 5:56 PM, Javier Viegas <[EMAIL PROTECTED]> wrote: > Thanks Daniel i ´ve removed the unexpected else secction. Now it works but > it tells me that there might be a syntax error on the query, this is good > news because now i know i´m having connection with the database but also > there must be something wrong with the query. > > > $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id']; [snip!] You didn't enclose the value in quotes, that's all (and you should sanitize the input --- NEVER accept data without sanitizing it first!). -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error: syntax error, unexpected T_ELSE
Hi, I suggest you echo $del_str to see exactly what your query is. There may be something unexpected in $_GET['Id']. Echo the whole query so you can see everything in context. Gary > -Original Message- > From: Javier Viegas [mailto:[EMAIL PROTECTED] > Sent: Tue, April 15, 2008 5:56 PM > To: php-db@lists.php.net > Subject: Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE > > > Thanks Daniel i ´ve removed the unexpected else secction. Now > it works but > it tells me that there might be a syntax error on the query, > this is good > news because now i know i´m having connection with the > database but also > there must be something wrong with the query. > > $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id']; > > Is this correct, i´ve checked and the correct syntax to use > would be delete > from libros where bnumero='something'; > Given 'something' is taken from a variable called Id it seems > reasonable to > me the way it is written. Do you see anything wrong? > > Thanks again. > > > On Tue, Apr 15, 2008 at 6:03 PM, Daniel Brown > <[EMAIL PROTECTED]> wrote: > > > On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas > <[EMAIL PROTECTED]> > > wrote: > > > Hi, i have this script wich basically connects to a > database and delete > > a > > > record according to the Id parameter given. The problem > is that when i > > test > > > it i get this error: > > > > > > *Parse error*: syntax error, unexpected T_ELSE in * > > > /var/www/biblio/scripts/delete.php* on line *31 > > > > Javier, > > > >This block: > > > > } else { > > $r_string = '&errorcode=4&'; > > > > } > > > > is incorrect. You call an else condition on line > 21, so PHP > > expects that block to be the last for that if() condition. Either > > remove the } else { and $r_string = '&errorcode=4&'; lines > or rewrite > > the condition. > > > >And if that's your real database login information, change it and > > update all of your scripts and systems ASAP. > > > > > > > > > > This is the script: > > > > > > * > > /* > > >deletescore.php: deletes record for passed id from > highscores table > > and > > > returns status to Flash > > > */ > > > // fill with correct data for your server configuration > > > $server = "localhost"; > > > $username = "root"; > > > $password = "itsveryeasy"; > > > $database = "biblioteca"; > > > > > > //connect to database added by calm > > > mysql_connect($server, $username, $password); > > > > > > if (!mysql_connect($server, $username, $password)) { > > >$r_string = '&errorcode=1&'; > > > > > > } elseif (!mysql_select_db($database)) { > > >$r_string = '&errorcode=2&'; > > > > > > } else { > > > > > > $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id']; > > > > > > if (!mysql_query ($del_str)) { > > > $msg = mysql_error(); > > > $r_string = '&errorcode=3&msg='.$msg; > > > } else { > > > $r_string = '&errorcode=0&'; > > > } > > >} else { > > > $r_string = '&errorcode=4&'; > > > > > > } > > > > > > echo $r_string; > > > ?> > > > > > > Wha am i doing wrong?? > > > > > > Thanks. > > > > > > Javier > > > > > > > > > > > -- > > > > Ask me about: > > Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., > > and shared hosting starting @ $2.50/mo. > > Unmanaged, managed, and fully-managed! > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE
Thanks Daniel i ´ve removed the unexpected else secction. Now it works but it tells me that there might be a syntax error on the query, this is good news because now i know i´m having connection with the database but also there must be something wrong with the query. $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id']; Is this correct, i´ve checked and the correct syntax to use would be delete from libros where bnumero='something'; Given 'something' is taken from a variable called Id it seems reasonable to me the way it is written. Do you see anything wrong? Thanks again. On Tue, Apr 15, 2008 at 6:03 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas <[EMAIL PROTECTED]> > wrote: > > Hi, i have this script wich basically connects to a database and delete > a > > record according to the Id parameter given. The problem is that when i > test > > it i get this error: > > > > *Parse error*: syntax error, unexpected T_ELSE in * > > /var/www/biblio/scripts/delete.php* on line *31 > > Javier, > >This block: > > } else { > $r_string = '&errorcode=4&'; > > } > > is incorrect. You call an else condition on line 21, so PHP > expects that block to be the last for that if() condition. Either > remove the } else { and $r_string = '&errorcode=4&'; lines or rewrite > the condition. > >And if that's your real database login information, change it and > update all of your scripts and systems ASAP. > > > > > > This is the script: > > > > * > /* > >deletescore.php: deletes record for passed id from highscores table > and > > returns status to Flash > > */ > > // fill with correct data for your server configuration > > $server = "localhost"; > > $username = "root"; > > $password = "itsveryeasy"; > > $database = "biblioteca"; > > > > //connect to database added by calm > > mysql_connect($server, $username, $password); > > > > if (!mysql_connect($server, $username, $password)) { > >$r_string = '&errorcode=1&'; > > > > } elseif (!mysql_select_db($database)) { > >$r_string = '&errorcode=2&'; > > > > } else { > > > > $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id']; > > > > if (!mysql_query ($del_str)) { > > $msg = mysql_error(); > > $r_string = '&errorcode=3&msg='.$msg; > > } else { > > $r_string = '&errorcode=0&'; > > } > >} else { > > $r_string = '&errorcode=4&'; > > > > } > > > > echo $r_string; > > ?> > > > > Wha am i doing wrong?? > > > > Thanks. > > > > Javier > > > > > > -- > > Ask me about: > Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., > and shared hosting starting @ $2.50/mo. > Unmanaged, managed, and fully-managed! >
Re: [PHP-DB] Parse error: syntax error, unexpected T_ELSE
On Tue, Apr 15, 2008 at 4:49 PM, Javier Viegas <[EMAIL PROTECTED]> wrote: > Hi, i have this script wich basically connects to a database and delete a > record according to the Id parameter given. The problem is that when i test > it i get this error: > > *Parse error*: syntax error, unexpected T_ELSE in * > /var/www/biblio/scripts/delete.php* on line *31 Javier, This block: } else { $r_string = '&errorcode=4&'; } is incorrect. You call an else condition on line 21, so PHP expects that block to be the last for that if() condition. Either remove the } else { and $r_string = '&errorcode=4&'; lines or rewrite the condition. And if that's your real database login information, change it and update all of your scripts and systems ASAP. > > This is the script: > > * /* >deletescore.php: deletes record for passed id from highscores table and > returns status to Flash > */ > // fill with correct data for your server configuration > $server = "localhost"; > $username = "root"; > $password = "itsveryeasy"; > $database = "biblioteca"; > > //connect to database added by calm > mysql_connect($server, $username, $password); > > if (!mysql_connect($server, $username, $password)) { >$r_string = '&errorcode=1&'; > > } elseif (!mysql_select_db($database)) { >$r_string = '&errorcode=2&'; > > } else { > > $del_str = "DELETE FROM libros WHERE bnumero=".$_GET['Id']; > > if (!mysql_query ($del_str)) { > $msg = mysql_error(); > $r_string = '&errorcode=3&msg='.$msg; > } else { > $r_string = '&errorcode=0&'; > } >} else { > $r_string = '&errorcode=4&'; > > } > > echo $r_string; > ?> > > Wha am i doing wrong?? > > Thanks. > > Javier > -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error: syntax error, unexpected T_ELSE
Hi, i have this script wich basically connects to a database and delete a record according to the Id parameter given. The problem is that when i test it i get this error: *Parse error*: syntax error, unexpected T_ELSE in * /var/www/biblio/scripts/delete.php* on line *31 This is the script: * Wha am i doing wrong?? Thanks. Javier
Re: [PHP-DB] parse error in create statement.
Missing a . in the line before the last quote GRANT CREATE TRIGGER TO ".$adduser" "$sqlstmt= "CREATE USER ".$adduser." PROFILE DEFAULT IDENTIFIED BY ".$addpass." DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON USERS ACCOUNT UNLOCK; GRANT CREATE TABLE TO ".$adduser." GRANT CREATE TRIGGER TO ".$adduser." GRANT CONNECT TO ".$adduser;". bastien From: Chris Ramsay <[EMAIL PROTECTED]> Reply-To: Chris Ramsay <[EMAIL PROTECTED]> To: babu <[EMAIL PROTECTED]> CC: php-db@lists.php.net Subject: Re: [PHP-DB] parse error in create statement. Date: Tue, 14 Jun 2005 10:56:24 +0100 Check your placement of all the '.' for a start. raz On 6/14/05, babu <[EMAIL PROTECTED]> wrote: > HI, > > Whats the error in this code. > > "$sqlstmt= "CREATE USER ".$adduser." PROFILE DEFAULT > IDENTIFIED BY ".$addpass." DEFAULT TABLESPACE USERS > TEMPORARY TABLESPACE TEMP > QUOTA UNLIMITED > ON USERS > ACCOUNT UNLOCK; > GRANT CREATE TABLE TO ".$adduser." > GRANT CREATE TRIGGER TO ".$adduser" > GRANT CONNECT TO ".$adduser;". > > > any suggestions. > > > > - > Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] parse error in create statement.
"$sqlstmt= "CREATE USER ".$adduser." PROFILE DEFAULT IDENTIFIED BY ".$addpass." DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON USERS ACCOUNT UNLOCK; GRANT CREATE TABLE TO ".$adduser." GRANT CREATE TRIGGER TO ".$adduser." GRANT CONNECT TO ".$adduser."; for the .'s
Re: [PHP-DB] parse error in create statement.
Also, correct me if I'm wrong, but this needs to be split into two seperate query strings and executed seperately... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] parse error in create statement.
Check your placement of all the '.' for a start. raz On 6/14/05, babu <[EMAIL PROTECTED]> wrote: > HI, > > Whats the error in this code. > > "$sqlstmt= "CREATE USER ".$adduser." PROFILE DEFAULT > IDENTIFIED BY ".$addpass." DEFAULT TABLESPACE USERS > TEMPORARY TABLESPACE TEMP > QUOTA UNLIMITED > ON USERS > ACCOUNT UNLOCK; > GRANT CREATE TABLE TO ".$adduser." > GRANT CREATE TRIGGER TO ".$adduser" > GRANT CONNECT TO ".$adduser;". > > > any suggestions. > > > > - > Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] parse error in create statement.
HI, Whats the error in this code. "$sqlstmt= "CREATE USER ".$adduser." PROFILE DEFAULT IDENTIFIED BY ".$addpass." DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON USERS ACCOUNT UNLOCK; GRANT CREATE TABLE TO ".$adduser." GRANT CREATE TRIGGER TO ".$adduser" GRANT CONNECT TO ".$adduser;". any suggestions. - Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail
[PHP-DB] parse error (with coding)
hi i had created an inventory management system..using php on sqlitei can successfully insert the values in it..but when i try to delete an item it is giving me an error...i think there is some logical problem in delete statement... can anyone help me in figure out this error.. thanks in advance... i am attaching the code View Inventory University of New Orleans successfully deleted!"; } else { echo "hahah!!!"; } } $query = "SELECT * FROM inventory "; $result = sqlite_query($handle,$query) or die("err:".sqlite_error_string(sqlite_last_error($handle))); if (sqlite_num_rows($result) > 0) { echo ""; while ($row = sqlite_fetch_array($result)) { echo ""; echo "".$row[0].""; echo "".$row[1].""; echo "".$row[2].""; echo "".$row[3].""; echo "".$row[4].""; echo "".$row[5].""; echo "".$row[6].""; echo "".$row[7].""; echo "".$row[8].""; echo "".$row[9].""; echo ""; } echo ""; } sqlite_close($handle); ?> __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] parse error
hi, i am trying to delete an item from inventory management system done by using php on sqlite... i had created a button 'delete' and when i submit a value to be deleted from the table it is giving an error,i think there is some problem with delete logic ... i am attaching the following codes: 1)html(delete.html) code which is working.. 2)php code(td.php) in which there is error can anyone help me in figure out the error ... thanks in advance ---regards - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com
Re: [PHP-DB] parse error in php backend sqlite
Aravalli Sai wrote: hi this is php code for inventory management system which is done using SQLite.this is an user interface where an user wil giv values to the text boxes and it should be saved in the backend database which is sqlite.. but when i run this code on browser it is giving an error ... Parse error: parse error in /home/saravall/.HTML/inv.php on line 63 $db ="/home/saravall/office.db"; $handle = sqlite_open($db) or die("could not open database"); if(isset($_POST['submit'])) { if (!empty($_post['tagno']) && !empty ($_post['desc']) && !empty ($_post['acqdt']) && !empty ($_post['manufacturer']) && !empty ($_post['model']) &&!empty($_post['serialid']) && !empty( $_post ['custloc']) && !empty($_post['totcost'])) { $insquery = "insert into inventory (tagno,desc,acqdt,manufacturer,model, serial id,custloc,totcost) values (\"".sqlite_escape_string( $_post['tagno'])."\",\"".sqlite_escape_string($_post['desc'])."\",\"" .sqlite_escape_string($_post['serialid'])."\",\"".sqlite_escape_string($_post ['custloc'])."\",\"".sqlite_escape_string($_post['totcost'])."\")"; $insresult = sqlite_query($handle,$insquery) or die("error:".sqlite_error_string(sqlite_last_error($handle))); echo "successfully inserted!"; } else { echo "incomplete from input!"; $query = "SELECT * FROM inventory "; $result = sqlite_query($handle,$query) or die("err:".sqlite_error_string(sqlite_last_error($handle))); if (sqlite_num_rows($result) > 0) { echo ""; while ($row = sqlite_fetch_array($result)) { echo ""; echo "".$row[0].""; echo "".$row[1].""; echo "".$row[2].""; echo "".$row[3].""; echo "".$row[4].""; echo "".$row[5].""; echo "".$row[6].""; echo "".$row[7].""; echo "".$row[8].""; echo "".$row[9].""; echo ""; } echo ""; } sqlite_close($handle); ?> i would appreciate if you can help me in correcting this error.. thanks in advance.. sai Your braces don't match up. The problem starts at the ELSE statement in line 33. Doug -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] parse error in php backend sqlite
- Original message from Aravalli Sai : -- > but when i run this code on browser it is giving an > error ... Parse error: parse error in > /home/saravall/.HTML/inv.php on line 63 > It would be helpful if you said what the parse error is and which line is 63. > if(isset($_POST['submit'])) { > > if (!empty($_post['tagno']) && !empty Why are you switching between $_POST and $_post? The superglobal array is $_POST. > i would appreciate if you can help me in correcting > this error.. > thanks in advance.. > sai Your curly braces, {}, don't match up. You aren't closing them all. Indenting your code will help you see this and fix the problem. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] parse error in php backend sqlite
hi this is php code for inventory management system which is done using SQLite.this is an user interface where an user wil giv values to the text boxes and it should be saved in the backend database which is sqlite.. but when i run this code on browser it is giving an error ... Parse error: parse error in /home/saravall/.HTML/inv.php on line 63 successfully inserted!"; } else { echo "incomplete from input!"; $query = "SELECT * FROM inventory "; $result = sqlite_query($handle,$query) or die("err:".sqlite_error_string(sqlite_last_error($handle))); if (sqlite_num_rows($result) > 0) { echo ""; while ($row = sqlite_fetch_array($result)) { echo ""; echo "".$row[0].""; echo "".$row[1].""; echo "".$row[2].""; echo "".$row[3].""; echo "".$row[4].""; echo "".$row[5].""; echo "".$row[6].""; echo "".$row[7].""; echo "".$row[8].""; echo "".$row[9].""; echo ""; } echo ""; } sqlite_close($handle); ?> i would appreciate if you can help me in correcting this error.. thanks in advance.. sai ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] parse error in php code backend SQLite
hi this is php code for inventory management system which is done using SQLite.this is an user interface where an user wil giv values to the text boxes and it should be saved in the backend database which is sqlite.. but when i run this code on browser it is giving an error ... Parse error: parse error in /home/saravall/.HTML/inv.php on line 81 successfully inserted!"; } else { echo "incomplete from input!"; $query = "SELECT * FROM inventory "; $result = sqlite_query($handle,$query) or die("err:".sqlite_error_string(sqlite_last_error($handle))); if (sqlite_num_rows($result) > 0) { echo ""; while ($row = sqlite_fetch_array($result)) { echo ""; echo "".$row[0].""; echo "".$row[1].""; echo "".$row[2].""; echo "".$row[3].""; echo "".$row[4].""; echo "".$row[5].""; echo "".$row[6].""; echo "".$row[7].""; echo "".$row[8].""; echo "".$row[9].""; echo ""; } echo ""; } sqlite_close($handle); ?> enter new record: Tag number: desc: acq date: manufacturer: model: serial id: custodian location: sum cost: ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error on array and SQL query
If you're not getting the parse error anymore, I'd suggest you echo $query to the browser and check to see that the SQL statement is what you expect it to be. Can't count the number of times doing that has pointed out some stray apostrophe or comma or something that killed the query. > -Original Message- > From: John W. Holmes [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 20, 2003 1:09 PM > To: Dillon, John > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Parse error on array and SQL query > > > Dillon, John wrote: > > > Tried that, doesn't work with: > > > > $query="INSERT INTO ReplyTbl VALUES ('" . $monster1 . "', '" . > > $monster2 . > > "', '" . $monster3 . "', NULL, NULL)"; > > > > Don't suppose they use 'monster' as a reserved word... > > How does it "not work" again?? > > -- > ---John Holmes... > > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ > > php|architect: The Magazine for PHP Professionals www.phparch.com > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error on array and SQL query
Dillon, John wrote: > Tried that, doesn't work with: > > $query="INSERT INTO ReplyTbl VALUES ('" . $monster1 . "', '" . > $monster2 . > "', '" . $monster3 . "', NULL, NULL)"; > > Don't suppose they use 'monster' as a reserved word... How does it "not work" again?? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error on array and SQL query
Dillon, John wrote: > On line 188 and similar: > line 187$this=$altIDs[$i]; > line 188$query .= "ID='$this'"; > > I get the error: Parse error: parse error in > /home/jdillon/public_html/provreport.php on line 188 > > Could this be because some setting has been changed on my shared host? $this is normally used in object oriented programming to signify the current object. That may be causing the trouble. I'd use another variable than $this. -- ---John Holmes... Tried that, doesn't work with: $query="INSERT INTO ReplyTbl VALUES ('" . $monster1 . "', '" . $monster2 . "', '" . $monster3 . "', NULL, NULL)"; Don't suppose they use 'monster' as a reserved word... but the similar code works in another file. John http://www.cantor.com CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Copyright and any other intellectual property rights in its contents are the sole property of Cantor Fitzgerald. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). For further important information, please read the Important Legal Information and Legal Statement at http://www.cantor.com/legal_information.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error on array and SQL query
Dillon, John wrote: On line 188 and similar: line 187 $this=$altIDs[$i]; line 188 $query .= "ID='$this'"; I get the error: Parse error: parse error in /home/jdillon/public_html/provreport.php on line 188 Could this be because some setting has been changed on my shared host? $this is normally used in object oriented programming to signify the current object. That may be causing the trouble. I'd use another variable than $this. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error on array and SQL query
My host provider suggested escaping the SQL: $query .= "ID=\'$this\'"; which gets rid of the php error but gives invalid SQL. After a few exchanges with them it suddenly worked again as: $query .= "ID='$this'";. -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED] Sent: 20 November 2003 14:43 To: 'Dillon, John'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Parse error on array and SQL query Speaking for myself only, I'm probably going to need to see more code than this to be able to help. These two lines appear to be OK. The error might be in what feeds line 187. > -Original Message- > From: Dillon, John [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 20, 2003 9:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Parse error on array and SQL query > > > > On line 188 and similar: > line 187$this=$altIDs[$i]; > line 188$query .= "ID='$this'"; > > I get the error: Parse error: parse error in > /home/jdillon/public_html/provreport.php on line 188 > > Could this be because some setting has been changed on my shared host? > > John > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.cantor.com > CONFIDENTIAL: This e-mail, including its contents and > attachments, if any, are confidential. If you are not the > named recipient please notify the sender and immediately > delete it. You may not disseminate, distribute, or forward > this e-mail message or disclose its contents to anybody else. > Copyright and any other intellectual property rights in its > contents are the sole property of Cantor Fitzgerald. > E-mail transmission cannot be guaranteed to be secure or > error-free. The sender therefore does not accept liability > for any errors or omissions in the contents of this message > which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. > Although we routinely screen for viruses, addressees > should check this e-mail and any attachments for viruses. We > make no representation or warranty as to the absence of > viruses in this e-mail or any attachments. Please note that > to ensure regulatory compliance and for the protection of our > customers and business, we may monitor and read e-mails sent > to and from our server(s). > > For further important information, please read the Important > Legal Information and Legal Statement at > http://www.cantor.com/legal_information.html > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error on array and SQL query
Speaking for myself only, I'm probably going to need to see more code than this to be able to help. These two lines appear to be OK. The error might be in what feeds line 187. > -Original Message- > From: Dillon, John [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 20, 2003 9:16 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Parse error on array and SQL query > > > > On line 188 and similar: > line 187$this=$altIDs[$i]; > line 188$query .= "ID='$this'"; > > I get the error: Parse error: parse error in > /home/jdillon/public_html/provreport.php on line 188 > > Could this be because some setting has been changed on my shared host? > > John > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.cantor.com > CONFIDENTIAL: This e-mail, including its contents and > attachments, if any, are confidential. If you are not the > named recipient please notify the sender and immediately > delete it. You may not disseminate, distribute, or forward > this e-mail message or disclose its contents to anybody else. > Copyright and any other intellectual property rights in its > contents are the sole property of Cantor Fitzgerald. > E-mail transmission cannot be guaranteed to be secure or > error-free. The sender therefore does not accept liability > for any errors or omissions in the contents of this message > which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. > Although we routinely screen for viruses, addressees > should check this e-mail and any attachments for viruses. We > make no representation or warranty as to the absence of > viruses in this e-mail or any attachments. Please note that > to ensure regulatory compliance and for the protection of our > customers and business, we may monitor and read e-mails sent > to and from our server(s). > > For further important information, please read the Important > Legal Information and Legal Statement at > http://www.cantor.com/legal_information.html > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error on array and SQL query
On line 188 and similar: line 187$this=$altIDs[$i]; line 188$query .= "ID='$this'"; I get the error: Parse error: parse error in /home/jdillon/public_html/provreport.php on line 188 Could this be because some setting has been changed on my shared host? John http://www.cantor.com CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Copyright and any other intellectual property rights in its contents are the sole property of Cantor Fitzgerald. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). For further important information, please read the Important Legal Information and Legal Statement at http://www.cantor.com/legal_information.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] parse error.
Hi Micella You need to either slash-escape your insert query or use single quotes: $query="insert into dene (day,start_time) values (\"2003.09.25\",\"22:30\") " ; or $query="insert into dene (day,start_time) values ('2003.09.25','22:30') " ; steve M|cella Erdem Efe wrote: I am a new programmer of PHP4.3.3 an MySql 3.23 . When below script is executed "Parse error: parse error, unexpected T_DNUMBER in c:\program files\apache group\apache\htdocs\ilkdeneme21.php on line 17" is being seen. This may be very simple but I could not solve it.Could you help me for this error? Thanks for your attention [EMAIL PROTECTED] mysql_connect("localhost","username"); if (mysql_select_db($dbname)) { echo "connected";} else { echo "not connected";} $query="insert into dene (day,start_time) values ("2003.09.25","22:30") " ; $result=mysql_query($query); if ($result)) { echo "data girildi";} else { echo "data girilemedi"; exit;} ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP-DB] parse error.
Hi, There are at least two errors in your script: $query="insert into dene (day,start_time) values ("2003.09.25","22:30") " ; should be $query="insert into dene (day,start_time) values ('2003.09.25','22:30') " ; And if ($result)) should be if ($result) regards Henrik Hornemann > -Oprindelig meddelelse- > Fra: Mücella Erdem Efe [mailto:[EMAIL PROTECTED] > Sendt: 26. september 2003 00:52 > Til: [EMAIL PROTECTED] > Emne: [PHP-DB] parse error. > > > I am a new programmer of PHP4.3.3 an MySql 3.23 . > > When below script is executed > "Parse error: parse error, unexpected T_DNUMBER in c:\program > files\apache group\apache\htdocs\ilkdeneme21.php on line 17" > is being seen. > > This may be very simple but I could not solve it.Could you > help me for this > error? > Thanks for your attention > [EMAIL PROTECTED] > > > $dbname = 'mycmpe'; > > mysql_connect("localhost","username"); > if (mysql_select_db($dbname)) > { echo "connected";} > else > { echo "not connected";} > > $query="insert into dene (day,start_time) values > ("2003.09.25","22:30") " ; >$result=mysql_query($query); >if ($result)) > { echo "data girildi";} > else > { echo "data girilemedi"; > exit;} > > ?> > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] parse error.
I am a new programmer of PHP4.3.3 an MySql 3.23 . When below script is executed "Parse error: parse error, unexpected T_DNUMBER in c:\program files\apache group\apache\htdocs\ilkdeneme21.php on line 17" is being seen. This may be very simple but I could not solve it.Could you help me for this error? Thanks for your attention [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse error
[EMAIL PROTECTED] wrote: IBI> I am having a problem with a parse error. IBI> error: IBI> Parse error: parse error, unexpected ')' in IBI> /Users/timbest/Sites/cajunmikes/inc/menupage.php on line 75 IBI> Fatal error: Cannot instantiate non-existent class: menu in IBI> /Users/timbest/Sites/cajunmikes/TMPfj18cc2i20.php on line 7 IBI> The issue I am having is line 75 has no ')'. I am sure this error is IBI> causing the next fatal error. Anyone seen this before? I'm not sure what IBI> to do next since there is nothing on line 75... IBI> Thanks IBI> /T Post some code here... WBR, Max 'AMiGo' Gashkov [EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo http://www.journals.ru/users/endymion Distributed.net participant [408228][RC5-72] __ NP: [DJ DADO/ FINE ARTS] next madness -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error
I am having a problem with a parse error. error: Parse error: parse error, unexpected ')' in /Users/timbest/Sites/cajunmikes/inc/menupage.php on line 75 Fatal error: Cannot instantiate non-existent class: menu in /Users/timbest/Sites/cajunmikes/TMPfj18cc2i20.php on line 7 The issue I am having is line 75 has no ')'. I am sure this error is causing the next fatal error. Anyone seen this before? I'm not sure what to do next since there is nothing on line 75... Thanks /T -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse Error
if ($packages == "1"){ if ($airporttransfer == "car"){ $airporttransfer2 = "12.00"}; if ($airporttransfer == "bus"){ $airporttransfer2 = "10.00"}; if ($airporttransfer == "none"){ $airporttransfer2 = "0.00"}; }; () round brackets round the condition {} braces around the 'do it' bit :) HTH Peter -Original Message- From: Chris Payne [mailto:[EMAIL PROTECTED] Sent: 27 February 2003 00:43 To: php Subject: [PHP-DB] Parse Error Hi there everyone, I'm trying to run an if statement and inside that have other if's, but it keeps telling me I have a parse error on the first if in the if statement (The second if down). Can anyone see what i'm doing wrong? if ($packages == "1")( if ($airporttransfer == "car")( $airporttransfer2 = "12.00"); if ($airporttransfer == "bus")( $airporttransfer2 = "10.00"); if ($airporttransfer == "none")( $airporttransfer2 = "0.00"); ); Thanks for your help :-) Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error
If statements use curly braces. Do this: if ($packages == "1"){ if ($airporttransfer == "car") $airporttransfer2 = "12.00"); if ($airporttransfer == "bus") $airporttransfer2 = "10.00"); if ($airporttransfer == "none") $airporttransfer2 = "0.00"); } On Wed, 2003-02-26 at 16:42, Chris Payne wrote: > Hi there everyone, > > I'm trying to run an if statement and inside that have other if's, but it keeps > telling me I have a parse error on the first if in the if statement (The second if > down). Can anyone see what i'm doing wrong? > > if ($packages == "1")( > > if ($airporttransfer == "car")( > $airporttransfer2 = "12.00"); > if ($airporttransfer == "bus")( > $airporttransfer2 = "10.00"); > if ($airporttransfer == "none")( > $airporttransfer2 = "0.00"); > > ); > > Thanks for your help :-) > > Chris
[PHP-DB] Parse Error
Hi there everyone, I'm trying to run an if statement and inside that have other if's, but it keeps telling me I have a parse error on the first if in the if statement (The second if down). Can anyone see what i'm doing wrong? if ($packages == "1")( if ($airporttransfer == "car")( $airporttransfer2 = "12.00"); if ($airporttransfer == "bus")( $airporttransfer2 = "10.00"); if ($airporttransfer == "none")( $airporttransfer2 = "0.00"); ); Thanks for your help :-) Chris
Re: [PHP-DB] Parse Error...
Thank you!! This appears to have solved it... I didn't even think of using the "$message" variable instead of the "print()"... Sheesh... I still have LOTS to learn!! Chase "Micah Stevens" <[EMAIL PROTECTED]> wrote in message 1038878012.23696.129.camel@tyrell">news:1038878012.23696.129.camel@tyrell... > Remember, the print() function sends stuff to the browser. If you wish > to make the code output to the $message variable, you must use > additional assignment statements. > > I made some quick changes to the code below, try that: > > $server = ""; > $user = ""; > $pass = ""; > $db = ""; > $table = ""; > ?> > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > $to .= "Chase <[EMAIL PROTECTED]>"; > > $subject = "Price File Access History"; > > $message = ' > > Price File Access > > > > > > Date / Time > > > Logged IP Address > > > Logged Username > > > '; > > $link = mysql_connect("$server", "$user", "$pass"); > mysql_select_db("$db", $link); > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > DESC",$link); > $num_rows = mysql_num_rows($result); > > if($num_rows) { > // print(""); >while($row = mysql_fetch_row($result)) > >{ > > $message .= ""; > $message .= "$row[0]"; > $message .= "$row[1]"; > $message .= "$row[2]"; > $message .= ""; > > >} >$message .= ""; > } else { >$message .= "No Files To Show!!"; > > } > $message .= " > > "; > > $headers = "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > mail($to, $subject, $message, $headers); > > ?> > > > > On Mon, 2002-12-02 at 16:30, Chase wrote: > > There is a single quote and semicolon on the line under that I > > thought would be defining the end of the assignment. > > Should I have used double quotes instead of single? > > > > Chase > > > > > > "Micah Stevens" <[EMAIL PROTECTED]> wrote in message > > 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell... > > > There aren't any closing quotes on your $message variable or semicolon > > > to tell the parser that you're done with the assignment statement. > > > > > > -Micah > > > > > > > > > > > > > > > > > > On Mon, 2002-12-02 at 15:05, Chase wrote: > > > > When trying to execute the following script to send the contents of a > > table > > > > via "mail()" I am getting this error... > > > > > > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 > > > > > > > > The portion of this code inside the HTML tags works great for displaying > > the > > > > table on the screen, but when I include it in the larger script for > > sending > > > > a mail message, I get this error. > > > > > > > > I am sure that it is something simple that I have been too stupid to > > catch, > > > > but any help would be great! > > > > > > > > Chase > > > > > > > > > > > > Code Follows ---> > > > > > > > > > > > $server = ""; > > > > $user = ""; > > > > $pass = ""; > > > > $db = ""; > > > > $table = ""; > > > > ?> > > > > > > > > > > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > > > > $to .= "Chase <[EMAIL PROTECTED]>"; > > > > > > > > $subject = "Price File Access History"; > > > > > > > > $message = ' > > > > > > > > Price File Access > > > > > > > > > > > > > > > > > > > > > > > > Date / Time > > > > > > > > > > > > Logged IP Address > > > > > > > > > > > > Logged Username > > > > > > > > > > > > > > > > $link = mysql_connect("$server", "$user", "$pass"); > > > > mysql_select_db("$db", $link); > > > > > > > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > > > > DESC",$link); > > > > $num_rows = mysql_num_rows($result); > > > > > > > > if($num_rows) { > > > > // print(""); > > > >while($row = mysql_fetch_row($result)) > > > > > > > >{ > > > > > > > > print(""); > > > > print("$row[0]"); > > > > print("$row[1]"); > > > > print("$row[2]"); > > > > print(""); > > > > > > > > > > > >} > > > >print(""); > > > > } else { > > > >print("No Files To Show!!"); > > > > > > > > } > > > > > > > > > > > > > > > > '; > > > > > > > > $headers = "MIME-Version: 1.0\r\n"; > > > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > > > > > > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > > > > > > > mail($to, $subject, $message, $headers); > > > > > > > > ?> > > > > > > > -- > > > Raincross Technologies > > > Development and Consulting Services > > > http://www.raincross-tech.com > > > > > > > -- > Raincross Technologies > Development and Consulting Services > http://www.raincross-tech.com > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n
Re: [PHP-DB] Parse Error...
Remember, the print() function sends stuff to the browser. If you wish to make the code output to the $message variable, you must use additional assignment statements. I made some quick changes to the code below, try that: " . ", " ; $to .= "Chase <[EMAIL PROTECTED]>"; $subject = "Price File Access History"; $message = ' Price File Access Date / Time Logged IP Address Logged Username '; $link = mysql_connect("$server", "$user", "$pass"); mysql_select_db("$db", $link); $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' DESC",$link); $num_rows = mysql_num_rows($result); if($num_rows) { // print(""); while($row = mysql_fetch_row($result)) { $message .= ""; $message .= "$row[0]"; $message .= "$row[1]"; $message .= "$row[2]"; $message .= ""; } $message .= ""; } else { $message .= "No Files To Show!!"; } $message .= " "; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; mail($to, $subject, $message, $headers); ?> On Mon, 2002-12-02 at 16:30, Chase wrote: > There is a single quote and semicolon on the line under that I > thought would be defining the end of the assignment. > Should I have used double quotes instead of single? > > Chase > > > "Micah Stevens" <[EMAIL PROTECTED]> wrote in message > 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell... > > There aren't any closing quotes on your $message variable or semicolon > > to tell the parser that you're done with the assignment statement. > > > > -Micah > > > > > > > > > > > > On Mon, 2002-12-02 at 15:05, Chase wrote: > > > When trying to execute the following script to send the contents of a > table > > > via "mail()" I am getting this error... > > > > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 > > > > > > The portion of this code inside the HTML tags works great for displaying > the > > > table on the screen, but when I include it in the larger script for > sending > > > a mail message, I get this error. > > > > > > I am sure that it is something simple that I have been too stupid to > catch, > > > but any help would be great! > > > > > > Chase > > > > > > > > > Code Follows ---> > > > > > > > > $server = ""; > > > $user = ""; > > > $pass = ""; > > > $db = ""; > > > $table = ""; > > > ?> > > > > > > > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > > > $to .= "Chase <[EMAIL PROTECTED]>"; > > > > > > $subject = "Price File Access History"; > > > > > > $message = ' > > > > > > Price File Access > > > > > > > > > > > > > > > > > > Date / Time > > > > > > > > > Logged IP Address > > > > > > > > > Logged Username > > > > > > > > > > > > $link = mysql_connect("$server", "$user", "$pass"); > > > mysql_select_db("$db", $link); > > > > > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > > > DESC",$link); > > > $num_rows = mysql_num_rows($result); > > > > > > if($num_rows) { > > > // print(""); > > >while($row = mysql_fetch_row($result)) > > > > > >{ > > > > > > print(""); > > > print("$row[0]"); > > > print("$row[1]"); > > > print("$row[2]"); > > > print(""); > > > > > > > > >} > > >print(""); > > > } else { > > >print("No Files To Show!!"); > > > > > > } > > > > > > > > > > > > '; > > > > > > $headers = "MIME-Version: 1.0\r\n"; > > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > > > > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > > > > > mail($to, $subject, $message, $headers); > > > > > > ?> > > > > > -- > > Raincross Technologies > > Development and Consulting Services > > http://www.raincross-tech.com > > > > -- Raincross Technologies Development and Consulting Services http://www.raincross-tech.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error...
Okay, you just jumped WAY outside my basic knowledge... However, it does make perfect sense, so I am off to the library... Chase "Jim Hunter" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In that case, your logic is not going to work. You have live PHP code inside a string. You are going to need to build the $message in pieces. Start with the HTML, then add the result from each itteration of your PHP loop to $message then add the trailing HTML to form the complete $message. Your close, but it's just not going to work like you think it will. Jim ---Original Message--- From: Chase Date: Monday, December 02, 2002 04:34:18 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Parse Error... There is a single quote and semicolon on the line under that I thought would be defining the end of the assignment. Should I have used double quotes instead of single? Chase "Micah Stevens" <[EMAIL PROTECTED]> wrote in message 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell... > There aren't any closing quotes on your $message variable or semicolon > to tell the parser that you're done with the assignment statement. > > -Micah > > > > > > On Mon, 2002-12-02 at 15:05, Chase wrote: > > When trying to execute the following script to send the contents of a table > > via "mail()" I am getting this error... > > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 > > > > The portion of this code inside the HTML tags works great for displaying the > > table on the screen, but when I include it in the larger script for sending > > a mail message, I get this error. > > > > I am sure that it is something simple that I have been too stupid to catch, > > but any help would be great! > > > > Chase > > > > > > Code Follows ---> > > > > > $server = ""; > > $user = ""; > > $pass = ""; > > $db = ""; > > $table = ""; > > ?> > > > > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > > $to .= "Chase <[EMAIL PROTECTED]>"; > > > > $subject = "Price File Access History"; > > > > $message = ' > > > > Price File Access > > > > > > > > > > > > Date / Time > > > > > > Logged IP Address > > > > > > Logged Username > > > > > > > > $link = mysql_connect("$server", "$user", "$pass"); > > mysql_select_db("$db", $link); > > > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > > DESC",$link); > > $num_rows = mysql_num_rows($result); > > > > if($num_rows) { > > // print(""); > > while($row = mysql_fetch_row($result)) > > > > { > > > > print(""); > > print("$row[0]"); > > print("$row[1]"); > > print("$row[2]"); > > print(""); > > > > > > } > > print(""); > > } else { > > print("No Files To Show!!"); > > > > } > > > > > > > > '; > > > > $headers = "MIME-Version: 1.0\r\n"; > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > > > mail($to, $subject, $message, $headers); > > > > ?> > > > -- > Raincross Technologies > Development and Consulting Services > http://www.raincross-tech.com > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php . -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error...
In that case, your logic is not going to work. You have live PHP code inside a string. You are going to need to build the $message in pieces. Start with the HTML, then add the result from each itteration of your PHP loop to $message then add the trailing HTML to form the complete $message. Your close, but it's just not going to work like you think it will. Jim ---Original Message--- From: Chase Date: Monday, December 02, 2002 04:34:18 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Parse Error... There is a single quote and semicolon on the line under that I thought would be defining the end of the assignment. Should I have used double quotes instead of single? Chase "Micah Stevens" <[EMAIL PROTECTED]> wrote in message 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell... > There aren't any closing quotes on your $message variable or semicolon > to tell the parser that you're done with the assignment statement. > > -Micah > > > > > > On Mon, 2002-12-02 at 15:05, Chase wrote: > > When trying to execute the following script to send the contents of a table > > via "mail()" I am getting this error... > > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 > > > > The portion of this code inside the HTML tags works great for displaying the > > table on the screen, but when I include it in the larger script for sending > > a mail message, I get this error. > > > > I am sure that it is something simple that I have been too stupid to catch, > > but any help would be great! > > > > Chase > > > > > > Code Follows ---> > > > > > $server = ""; > > $user = ""; > > $pass = ""; > > $db = ""; > > $table = ""; > > ?> > > > > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > > $to .= "Chase <[EMAIL PROTECTED]>"; > > > > $subject = "Price File Access History"; > > > > $message = ' > > > > Price File Access > > > > > > > > > > > > Date / Time > > > > > > Logged IP Address > > > > > > Logged Username > > > > > > > > $link = mysql_connect("$server", "$user", "$pass"); > > mysql_select_db("$db", $link); > > > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > > DESC",$link); > > $num_rows = mysql_num_rows($result); > > > > if($num_rows) { > > // print(""); > > while($row = mysql_fetch_row($result)) > > > > { > > > > print(""); > > print("$row[0]"); > > print("$row[1]"); > > print("$row[2]"); > > print(""); > > > > > > } > > print(""); > > } else { > > print("No Files To Show!!"); > > > > } > > > > > > > > '; > > > > $headers = "MIME-Version: 1.0\r\n"; > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > > > mail($to, $subject, $message, $headers); > > > > ?> > > > -- > Raincross Technologies > Development and Consulting Services > http://www.raincross-tech.com > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php .
Re: [PHP-DB] Parse Error...
There is a single quote and semicolon on the line under that I thought would be defining the end of the assignment. Should I have used double quotes instead of single? Chase "Micah Stevens" <[EMAIL PROTECTED]> wrote in message 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell... > There aren't any closing quotes on your $message variable or semicolon > to tell the parser that you're done with the assignment statement. > > -Micah > > > > > > On Mon, 2002-12-02 at 15:05, Chase wrote: > > When trying to execute the following script to send the contents of a table > > via "mail()" I am getting this error... > > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 > > > > The portion of this code inside the HTML tags works great for displaying the > > table on the screen, but when I include it in the larger script for sending > > a mail message, I get this error. > > > > I am sure that it is something simple that I have been too stupid to catch, > > but any help would be great! > > > > Chase > > > > > > Code Follows ---> > > > > > $server = ""; > > $user = ""; > > $pass = ""; > > $db = ""; > > $table = ""; > > ?> > > > > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > > $to .= "Chase <[EMAIL PROTECTED]>"; > > > > $subject = "Price File Access History"; > > > > $message = ' > > > > Price File Access > > > > > > > > > > > > Date / Time > > > > > > Logged IP Address > > > > > > Logged Username > > > > > > > > $link = mysql_connect("$server", "$user", "$pass"); > > mysql_select_db("$db", $link); > > > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > > DESC",$link); > > $num_rows = mysql_num_rows($result); > > > > if($num_rows) { > > // print(""); > >while($row = mysql_fetch_row($result)) > > > >{ > > > > print(""); > > print("$row[0]"); > > print("$row[1]"); > > print("$row[2]"); > > print(""); > > > > > >} > >print(""); > > } else { > >print("No Files To Show!!"); > > > > } > > > > > > > > '; > > > > $headers = "MIME-Version: 1.0\r\n"; > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > > > mail($to, $subject, $message, $headers); > > > > ?> > > > -- > Raincross Technologies > Development and Consulting Services > http://www.raincross-tech.com > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error...
There aren't any closing quotes on your $message variable or semicolon to tell the parser that you're done with the assignment statement. -Micah On Mon, 2002-12-02 at 15:05, Chase wrote: > When trying to execute the following script to send the contents of a table > via "mail()" I am getting this error... > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 > > The portion of this code inside the HTML tags works great for displaying the > table on the screen, but when I include it in the larger script for sending > a mail message, I get this error. > > I am sure that it is something simple that I have been too stupid to catch, > but any help would be great! > > Chase > > > Code Follows ---> > > $server = ""; > $user = ""; > $pass = ""; > $db = ""; > $table = ""; > ?> > > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ; > $to .= "Chase <[EMAIL PROTECTED]>"; > > $subject = "Price File Access History"; > > $message = ' > > Price File Access > > > > > > Date / Time > > > Logged IP Address > > > Logged Username > > > > $link = mysql_connect("$server", "$user", "$pass"); > mysql_select_db("$db", $link); > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' > DESC",$link); > $num_rows = mysql_num_rows($result); > > if($num_rows) { > // print(""); >while($row = mysql_fetch_row($result)) > >{ > > print(""); > print("$row[0]"); > print("$row[1]"); > print("$row[2]"); > print(""); > > >} >print(""); > } else { >print("No Files To Show!!"); > > } > > > > '; > > $headers = "MIME-Version: 1.0\r\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; > > mail($to, $subject, $message, $headers); > > ?> > -- Raincross Technologies Development and Consulting Services http://www.raincross-tech.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse Error...
When trying to execute the following script to send the contents of a table via "mail()" I am getting this error... Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36 The portion of this code inside the HTML tags works great for displaying the table on the screen, but when I include it in the larger script for sending a mail message, I get this error. I am sure that it is something simple that I have been too stupid to catch, but any help would be great! Chase Code Follows ---> " . ", " ; $to .= "Chase <[EMAIL PROTECTED]>"; $subject = "Price File Access History"; $message = ' Price File Access Date / Time Logged IP Address Logged Username $link = mysql_connect("$server", "$user", "$pass"); mysql_select_db("$db", $link); $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date' DESC",$link); $num_rows = mysql_num_rows($result); if($num_rows) { // print(""); while($row = mysql_fetch_row($result)) { print(""); print("$row[0]"); print("$row[1]"); print("$row[2]"); print(""); } print(""); } else { print("No Files To Show!!"); } '; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n"; mail($to, $subject, $message, $headers); ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error when using global
Hallo everybody, I do have a little problem and can't come up with an answer. Can somebody help me? I would like to use two variables in a function, $database_viva and $viva. $database_viva = "test"; $username_viva = ""; $password_viva = ""; $viva = mysql_pconnect($hostname_viva, $username_viva, $password_viva) or die(mysql_error()); 365 function show($typ,$id) 366 { 367 global $database_viva,$viva; 368 //Datensaetze auswaehlen 369 mysql_select_db($database_viva, $viva); I receive this error message on my local system (Windows XP,PHP Version 4.2.3) Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_VARIABLE or '$' in d:\projekte\viva_neu\tmpggi4z2n7s1.php on line 367 But the script runs without a problem on the remote system (Unix,PHP 4.1.2) If I uncomment the 'global line' it is working local, but I get an error message on the remote system??? 365 function show($typ,$id) 366 { 367 //global $database_viva,$viva; 368 //Datensaetze auswaehlen 369 mysql_select_db($database_viva, $viva); Thanks for your help in advance, Claudia -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error
According to your code, if the checkbox next to the word 'remove' is checked, then the value of $cars passed to the form is "checkbox". Then in the done2.php3 page, you are trying to delete where checkbox='array of values listed'. Is there a field in your database called checkbox? If so, what field type is it set to? If not, there is your problem. HTH MB jas <[EMAIL PROTECTED]> said: > Here is the code from the file that queries the db and pulls the current > contents of the db and provides a check box form for each record to delete > the items in the db. I dont know if this will help but like I said before > any insight would be great. Thanks in advance. > Jas > > require '../scripts/db.php'; > $result = mysql_query("SELECT * FROM cur_inv",$dbh) or die("Could not > execute query, please try again later"); > echo " name=\"rem_inv\" method=\"post\" action=\"done2.php3\"> > Current > Inventory"; > $count = -1; > while ($myrow = mysql_fetch_row($result)) { > $count ++; > echo "Type Of Car: "; > printf(mysql_result($result,$count,"car_type")); > echo " value=\"checkbox\">remove > \n"; > echo "Model Of Car: "; > printf(mysql_result($result,$count,"car_model")); > echo "\n"; > echo "Year Of Car: "; > printf(mysql_result($result,$count,"car_year")); > echo "\n"; > echo "Price Of Car: $"; > printf(mysql_result($result,$count,"car_price")); > echo "\n"; > echo "VIN Of Car: "; > printf(mysql_result($result,$count,"car_vin")); > echo "\n"; > } > echo " value=\"delete\">"; > ?> > > After this file is pulled and the user selects which record to delete it > jumps to the other snippit of code in done2.php3 which is > > > > $db_name = "test"; > > > $table_name = "inventory"; > > > $connection = @mysql_connect("localhost", "root", "password") or die > > > ("Could > > > not connect to database. Please try again later."); > > > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > > > database table. Please try again later."); > > > $sql = "DELETE FROM $table_name WHERE $cars = > > > > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > > > r_num\""); > > > $result = @mysql_query($sql, $connection) or die ("Could not execute > > > query. > > > > > > Any insight would be great... thanks again. > > > Jas > > > > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > -- > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error
Could you maybe give me an example of how to associate the checkbox with the id? Thanks again, Jas "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Ok then it sure will not work.. because you have : > > "DELETE FROM $table_name WHERE $cars > =\"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$d > lr_num\""); > > 1- $cars is set to the value "checkbox" which doesn't exist in your test > table > 2- The end of the statement $dlr_num\""); is not right , that > parenthesis isn't supposed to be there > 3- The delete statement is wrong...You are storing all that info in the > separate fields but you are giving all combined as a condition in only one > field ($cars). > 3- Rewrite your delete statement to delete the rows identified by the id > column as "DELETE FROM $table WHERE id ='id'"; Of course in the page where > you list the cars to be deleted associate each checkbox with the car's id. > > Hope this helps.. > > Gurhan > > > -Original Message- > From: jas [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 21, 2002 1:02 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Parse Error > > > Here is the dump for the cars table... > test ( >id varchar(30) NOT NULL auto_increment, >car_type varchar(30), >car_model varchar(30), >car_year varchar(15), >car_price varchar(15), >car_vin varchar(25), >dlr_num varchar(25), >PRIMARY KEY (id), >KEY id (id) > test VALUES ('1', 'Ford', 'Bronco', '1969', '4500', 'vin897655', 'none'); > > Sorry about that... still a bit of a newbie here. =) > Jas > > "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Jas.. > > First of all you don't have the variable $cars assigned.. > > Second of all, we still don't know what the "test" table looks like? Does > it > > only have one column with all the infos about cars populated in it??? > > > > Gurhan > > > > > > -Original Message- > > From: jas [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 21, 2002 12:48 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-DB] Parse Error > > > > > > Here is the code from the file that queries the db and pulls the current > > contents of the db and provides a check box form for each record to delete > > the items in the db. I dont know if this will help but like I said before > > any insight would be great. Thanks in advance. > > Jas > > > > > require '../scripts/db.php'; > > $result = mysql_query("SELECT * FROM cur_inv",$dbh) or die("Could not > > execute query, please try again later"); > > echo " > name=\"rem_inv\" method=\"post\" action=\"done2.php3\"> > > Current > > Inventory"; > > $count = -1; > > while ($myrow = mysql_fetch_row($result)) { > > $count ++; > > echo "Type Of Car: "; > > printf(mysql_result($result,$count,"car_type")); > > echo " > value=\"checkbox\">remove > > \n"; > > echo "Model Of Car: "; > > printf(mysql_result($result,$count,"car_model")); > > echo "\n"; > > echo "Year Of Car: "; > > printf(mysql_result($result,$count,"car_year")); > > echo "\n"; > > echo "Price Of Car: $"; > > printf(mysql_result($result,$count,"car_price")); > > echo "\n"; > > echo "VIN Of Car: "; > > printf(mysql_result($result,$count,"car_vin")); > > echo "\n"; > > } > > echo " > value=\"delete\">"; > > ?> > > > > After this file is pulled and the user selects which record to delete it > > jumps to the other snippit of code in done2.php3 which is > > > > > > $db_name = "test"; > > > > $table_name = "inventory"; > > > > $connection = @mysql_connect("localhost", "root", "password") or die > > > > ("Could > > > > not connect to database. Please try again later."); > > > > $db = @mysql_select_db("$db_name",$connection) or die ("Could not > select > > > > database table. Please try again later."); > > > > $sql = "DELETE FROM $table_name WHERE $cars = > > > > > > > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > > > > r_num\""); > > > > $result = @mysql_query($sql, $connection) or die ("Could not execute > > > > query. > > > > > > > > Any insight would be great... thanks again. > > > > Jas > > > > > > > > > > > > > > > > > > > > -- > > > > PHP Database Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse Error
Ok then it sure will not work.. because you have : "DELETE FROM $table_name WHERE $cars =\"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$d lr_num\""); 1- $cars is set to the value "checkbox" which doesn't exist in your test table 2- The end of the statement $dlr_num\""); is not right , that parenthesis isn't supposed to be there 3- The delete statement is wrong...You are storing all that info in the separate fields but you are giving all combined as a condition in only one field ($cars). 3- Rewrite your delete statement to delete the rows identified by the id column as "DELETE FROM $table WHERE id ='id'"; Of course in the page where you list the cars to be deleted associate each checkbox with the car's id. Hope this helps.. Gurhan -Original Message----- From: jas [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 1:02 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Parse Error Here is the dump for the cars table... test ( id varchar(30) NOT NULL auto_increment, car_type varchar(30), car_model varchar(30), car_year varchar(15), car_price varchar(15), car_vin varchar(25), dlr_num varchar(25), PRIMARY KEY (id), KEY id (id) test VALUES ('1', 'Ford', 'Bronco', '1969', '4500', 'vin897655', 'none'); Sorry about that... still a bit of a newbie here. =) Jas "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jas.. > First of all you don't have the variable $cars assigned.. > Second of all, we still don't know what the "test" table looks like? Does it > only have one column with all the infos about cars populated in it??? > > Gurhan > > > -Original Message- > From: jas [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 21, 2002 12:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Parse Error > > > Here is the code from the file that queries the db and pulls the current > contents of the db and provides a check box form for each record to delete > the items in the db. I dont know if this will help but like I said before > any insight would be great. Thanks in advance. > Jas > > require '../scripts/db.php'; > $result = mysql_query("SELECT * FROM cur_inv",$dbh) or die("Could not > execute query, please try again later"); > echo " name=\"rem_inv\" method=\"post\" action=\"done2.php3\"> > Current > Inventory"; > $count = -1; > while ($myrow = mysql_fetch_row($result)) { > $count ++; > echo "Type Of Car: "; > printf(mysql_result($result,$count,"car_type")); > echo " value=\"checkbox\">remove > \n"; > echo "Model Of Car: "; > printf(mysql_result($result,$count,"car_model")); > echo "\n"; > echo "Year Of Car: "; > printf(mysql_result($result,$count,"car_year")); > echo "\n"; > echo "Price Of Car: $"; > printf(mysql_result($result,$count,"car_price")); > echo "\n"; > echo "VIN Of Car: "; > printf(mysql_result($result,$count,"car_vin")); > echo "\n"; > } > echo " value=\"delete\">"; > ?> > > After this file is pulled and the user selects which record to delete it > jumps to the other snippit of code in done2.php3 which is > > > > $db_name = "test"; > > > $table_name = "inventory"; > > > $connection = @mysql_connect("localhost", "root", "password") or die > > > ("Could > > > not connect to database. Please try again later."); > > > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > > > database table. Please try again later."); > > > $sql = "DELETE FROM $table_name WHERE $cars = > > > > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > > > r_num\""); > > > $result = @mysql_query($sql, $connection) or die ("Could not execute > > > query. > > > > > > Any insight would be great... thanks again. > > > Jas > > > > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > -- > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error
Here is the dump for the cars table... test ( id varchar(30) NOT NULL auto_increment, car_type varchar(30), car_model varchar(30), car_year varchar(15), car_price varchar(15), car_vin varchar(25), dlr_num varchar(25), PRIMARY KEY (id), KEY id (id) test VALUES ('1', 'Ford', 'Bronco', '1969', '4500', 'vin897655', 'none'); Sorry about that... still a bit of a newbie here. =) Jas "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jas.. > First of all you don't have the variable $cars assigned.. > Second of all, we still don't know what the "test" table looks like? Does it > only have one column with all the infos about cars populated in it??? > > Gurhan > > > -Original Message----- > From: jas [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 21, 2002 12:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Parse Error > > > Here is the code from the file that queries the db and pulls the current > contents of the db and provides a check box form for each record to delete > the items in the db. I dont know if this will help but like I said before > any insight would be great. Thanks in advance. > Jas > > require '../scripts/db.php'; > $result = mysql_query("SELECT * FROM cur_inv",$dbh) or die("Could not > execute query, please try again later"); > echo " name=\"rem_inv\" method=\"post\" action=\"done2.php3\"> > Current > Inventory"; > $count = -1; > while ($myrow = mysql_fetch_row($result)) { > $count ++; > echo "Type Of Car: "; > printf(mysql_result($result,$count,"car_type")); > echo " value=\"checkbox\">remove > \n"; > echo "Model Of Car: "; > printf(mysql_result($result,$count,"car_model")); > echo "\n"; > echo "Year Of Car: "; > printf(mysql_result($result,$count,"car_year")); > echo "\n"; > echo "Price Of Car: $"; > printf(mysql_result($result,$count,"car_price")); > echo "\n"; > echo "VIN Of Car: "; > printf(mysql_result($result,$count,"car_vin")); > echo "\n"; > } > echo " value=\"delete\">"; > ?> > > After this file is pulled and the user selects which record to delete it > jumps to the other snippit of code in done2.php3 which is > > > > $db_name = "test"; > > > $table_name = "inventory"; > > > $connection = @mysql_connect("localhost", "root", "password") or die > > > ("Could > > > not connect to database. Please try again later."); > > > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > > > database table. Please try again later."); > > > $sql = "DELETE FROM $table_name WHERE $cars = > > > > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > > > r_num\""); > > > $result = @mysql_query($sql, $connection) or die ("Could not execute > > > query. > > > > > > Any insight would be great... thanks again. > > > Jas > > > > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > -- > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse Error
Jas.. First of all you don't have the variable $cars assigned.. Second of all, we still don't know what the "test" table looks like? Does it only have one column with all the infos about cars populated in it??? Gurhan -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 12:48 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Parse Error Here is the code from the file that queries the db and pulls the current contents of the db and provides a check box form for each record to delete the items in the db. I dont know if this will help but like I said before any insight would be great. Thanks in advance. Jas Current Inventory"; $count = -1; while ($myrow = mysql_fetch_row($result)) { $count ++; echo "Type Of Car: "; printf(mysql_result($result,$count,"car_type")); echo "remove \n"; echo "Model Of Car: "; printf(mysql_result($result,$count,"car_model")); echo "\n"; echo "Year Of Car: "; printf(mysql_result($result,$count,"car_year")); echo "\n"; echo "Price Of Car: $"; printf(mysql_result($result,$count,"car_price")); echo "\n"; echo "VIN Of Car: "; printf(mysql_result($result,$count,"car_vin")); echo "\n"; } echo ""; ?> After this file is pulled and the user selects which record to delete it jumps to the other snippit of code in done2.php3 which is > > $db_name = "test"; > > $table_name = "inventory"; > > $connection = @mysql_connect("localhost", "root", "password") or die > > ("Could > > not connect to database. Please try again later."); > > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > > database table. Please try again later."); > > $sql = "DELETE FROM $table_name WHERE $cars = > > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > > r_num\""); > > $result = @mysql_query($sql, $connection) or die ("Could not execute > > query. > > > > Any insight would be great... thanks again. > > Jas > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse Error
Not enough information given to figure out what's going on, but looking at your query i see: "WHERE $cars = "$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dlr _num\""); do you keep 6 different values separated by commas in the field referenced by $cars??? If this is correct what values you are passing for all those variables? Is the $cars variable set to a valid column name in the "test" table?? What is the data type for the column that $cars references? Gurhan -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 12:26 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Parse Error I hate to post this again but I have looked in a couple of php and mysql books but cannot seem to figure this one out. I am getting a parse error when trying to use php to delete records from a table. The error I am recieving is as follows Parse error: parse error in /path/to/php/done2.php3 on line 22 Here is the file that is giving me the error, any help would be great... I think that my problem is that I left out a variable to hold the $cars data but I am not sure. Here is the code... $db_name = "test"; $table_name = "inventory"; $connection = @mysql_connect("localhost", "root", "password") or die ("Could not connect to database. Please try again later."); $db = @mysql_select_db("$db_name",$connection) or die ("Could not select database table. Please try again later."); $sql = "DELETE FROM $table_name WHERE $cars = \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl r_num\""); $result = @mysql_query($sql, $connection) or die ("Could not execute query. Any insight would be great... thanks again. Jas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error
Here is the code from the file that queries the db and pulls the current contents of the db and provides a check box form for each record to delete the items in the db. I dont know if this will help but like I said before any insight would be great. Thanks in advance. Jas Current Inventory"; $count = -1; while ($myrow = mysql_fetch_row($result)) { $count ++; echo "Type Of Car: "; printf(mysql_result($result,$count,"car_type")); echo "remove \n"; echo "Model Of Car: "; printf(mysql_result($result,$count,"car_model")); echo "\n"; echo "Year Of Car: "; printf(mysql_result($result,$count,"car_year")); echo "\n"; echo "Price Of Car: $"; printf(mysql_result($result,$count,"car_price")); echo "\n"; echo "VIN Of Car: "; printf(mysql_result($result,$count,"car_vin")); echo "\n"; } echo ""; ?> After this file is pulled and the user selects which record to delete it jumps to the other snippit of code in done2.php3 which is > > $db_name = "test"; > > $table_name = "inventory"; > > $connection = @mysql_connect("localhost", "root", "password") or die > > ("Could > > not connect to database. Please try again later."); > > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > > database table. Please try again later."); > > $sql = "DELETE FROM $table_name WHERE $cars = > > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > > r_num\""); > > $result = @mysql_query($sql, $connection) or die ("Could not execute > > query. > > > > Any insight would be great... thanks again. > > Jas > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Parse Error
Is $cars an array field? If not, you are trying to compare $cars to an list/array of values (I am not sure this would work even if $cars was an array field) 'WHERE $cars = "$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dlr _num\"");'. Normally, you would have to compare each individual value in each requested field to a variable. Hard to say without more code. MB jas <[EMAIL PROTECTED]> said: > I hate to post this again but I have looked in a couple of php and mysql > books but cannot seem to figure this one out. I am getting a parse error > when trying to use php to delete records from a table. The error I am > recieving is as follows > > Parse error: parse error in /path/to/php/done2.php3 on line 22 > > Here is the file that is giving me the error, any help would be great... I > think that my problem is that I left out a variable to hold the $cars data > but I am not sure. Here is the code... > > $db_name = "test"; > $table_name = "inventory"; > $connection = @mysql_connect("localhost", "root", "password") or die > ("Could > not connect to database. Please try again later."); > $db = @mysql_select_db("$db_name",$connection) or die ("Could not select > database table. Please try again later."); > $sql = "DELETE FROM $table_name WHERE $cars = > \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl > r_num\""); > $result = @mysql_query($sql, $connection) or die ("Could not execute > query. > > Any insight would be great... thanks again. > Jas > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse Error
I hate to post this again but I have looked in a couple of php and mysql books but cannot seem to figure this one out. I am getting a parse error when trying to use php to delete records from a table. The error I am recieving is as follows Parse error: parse error in /path/to/php/done2.php3 on line 22 Here is the file that is giving me the error, any help would be great... I think that my problem is that I left out a variable to hold the $cars data but I am not sure. Here is the code... $db_name = "test"; $table_name = "inventory"; $connection = @mysql_connect("localhost", "root", "password") or die ("Could not connect to database. Please try again later."); $db = @mysql_select_db("$db_name",$connection) or die ("Could not select database table. Please try again later."); $sql = "DELETE FROM $table_name WHERE $cars = \"$car_type\",\"$car_model\",\"$car_year\",\"$car_price\",\"$car_vin\",\"$dl r_num\""); $result = @mysql_query($sql, $connection) or die ("Could not execute query. Any insight would be great... thanks again. Jas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error
Hi Jenn, The code looked ok to me , so I copied and pasted the code you posted and it worked for me.. Where are you getting the parsing error? Is it the whole code anyway? Gurhan -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Parse error Can someone tell me why I am getting a parse error in this little snip? Original value is $origVar"; $origVar += 25; echo "Added a value, now it's $origVar"; $origVar -= 12; echo "Subtracted a value, now it's $origVar"; $origVar .= " chickens"; echo "Final answer: $origVar"; ?> Thanks in advance Jen Downey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Parse error
try: Original value is".$origVar.""; $origVar += 25; echo "Added a value, now it's ".$origVar.""; $origVar -= 12; echo "Subtracted a value, now it's ".$origVar.""; $origVar .= " chickens"; echo "Final answer: ".$origVar.""; ?> Cami -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 2:33 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Parse error Can someone tell me why I am getting a parse error in this little snip? Original value is $origVar"; $origVar += 25; echo "Added a value, now it's $origVar"; $origVar -= 12; echo "Subtracted a value, now it's $origVar"; $origVar .= " chickens"; echo "Final answer: $origVar"; ?> Thanks in advance Jen Downey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error
Can someone tell me why I am getting a parse error in this little snip? Original value is $origVar"; $origVar += 25; echo "Added a value, now it's $origVar"; $origVar -= 12; echo "Subtracted a value, now it's $origVar"; $origVar .= " chickens"; echo "Final answer: $origVar"; ?> Thanks in advance Jen Downey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parse error (a bit OT)
Hello, Can anyone tell me what's wrong with line 68? I get a parse error on line 68 trying to run this. The strange thing is that it doesn't complain about line 54. Either I'm blind, stupid, or there's somehing very wrong here. I've checked above line 67 too, but there doesn't seem to be any missing brackets or semicolons... Cheers, Markus 53: if ($prev_week) { 54:while(date("W",mktime(0,0,0,$m,$d,$Y))==$week) { ...blababla... } 67: if ($next_week) { 68:while(date("W",mktime(0,0,0,$m,$d,$Y))==$week) { ...blablabla... } -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] parse error
I'm working through the New Riders MySQL book and I get the following error when running a php script, can someone help? Thanks, Matt - Parse error: parse error in c:\program files\apache group\apache\htdocs\genesis\dump_info.php on line 25 Here's lines 25 - printf ("%s\n", htmlspecialchars ($row[$i])); Here's the full code if that helps - \n"); # read results of query, then clean up while ($row = mysql_fetch_row ($result)) { print ("\n); for ($i = 0; $i < mysql_num_fields ($result); $i++) { # escape any special characters and print printf ("%s\n", htmlspecialchars ($row[$i])); } print ("\n"); } mysql_free_result ($result); print ("\n"); html_end (); ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] parse error
On Thu, 2001-12-13 at 23:49, Rob Day wrote: As far as I can see, you're missing '; in line 360, unless it continues further down and terminates the $message string there. > Here is the offending code: > 353 if ($moderation == "no"){ > 354 $message .= " checked"; > 355 } > 356 > 357$message .= ' > 358>no > 359Answer "yes" if you want all postings to the list to be > sent to > 360 a moderator for approval before distribution to the > list. > > Any help would be greatly appreciated. Thanks! -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] parse error
the way to start this is to just add a couple of letters to the message and see if you're still getting an error - try (on line 357)... $message .=">no\nHello world"; keep it all on one line, and then see if you're still getting an error - if you are then i don't think this line is the one you have to worry about! -Original Message- From: Rob Day [mailto:[EMAIL PROTECTED]] Sent: 13 December 2001 21:49 To: '[EMAIL PROTECTED]' Subject: [PHP-DB] parse error I've written a small script that processes a form from a webpage and sends the submitted data as an HTML e-mail that has the form all filled out already. I've gotten smaller versions of this script to work without any problem just to test the idea.I can't figure out why I'm now getting the following error: Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3 on line 358 Here is the offending code: 353 if ($moderation == "no"){ 354 $message .= " checked"; 355 } 356 357$message .= ' 358>no 359Answer "yes" if you want all postings to the list to be sent to 360 a moderator for approval before distribution to the list. Any help would be greatly appreciated. Thanks! Rob Day Web Team Leader Texas State Library and Archives Commission phone: 512.936.4463 fax: 512.463.5436 [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] parse error
Rob - I think I see what you're doing: you're concatenating $message with something else (the HTML output following line 357?). Problem is, you're just stating the right hand side of what should be an assignment. The concatenation should be: $variable = $variable .= 'HTML output'; and it looks like you just have $variable .= 'HTML output'; although you didn't post enough code for me to be sure of this. If you didn't mean to concatenate something, trying taking the dot before the equal sign out of the statement. If I'm completely wrong as to what you're trying to do, apologies. cheers, db Rob Day wrote: > I've written a small script that processes a form from a webpage and sends > the submitted data as an HTML e-mail that has the form all filled out > already. I've gotten smaller versions of this script to work without any > problem just to test the idea.I can't figure out why I'm now getting the > following error: > Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3 > on line 358 > > Here is the offending code: > 353 if ($moderation == "no"){ > 354 $message .= " checked"; > 355 } > 356 > 357$message .= ' > 358>no > 359Answer "yes" if you want all postings to the list to be > sent to > 360 a moderator for approval before distribution to the > list. > > Any help would be greatly appreciated. Thanks! > > Rob Day > Web Team Leader > Texas State Library and Archives Commission > phone: 512.936.4463 fax: 512.463.5436 > [EMAIL PROTECTED] > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- -- Dan Barton Terrestrial Program Biologist Asst. Data Manager Point Reyes Bird Observatory http://www.prbo.org [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] parse error
Is it possible that there's a string farther up with an unclosed single-quote? --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer| at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell > -Original Message- > From: Rob Day [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 13, 2001 3:49 PM > To: '[EMAIL PROTECTED]' > Subject: [PHP-DB] parse error > > > I've written a small script that processes a form from a > webpage and sends > the submitted data as an HTML e-mail that has the form all filled out > already. I've gotten smaller versions of this script to work > without any > problem just to test the idea.I can't figure out why I'm now > getting the > following error: > Parse error: parse error in > /home/httpd/cgi-bin/rday/lists/do_listapp.php3 > on line 358 > > Here is the offending code: > 353 if ($moderation == "no"){ > 354 $message .= " checked"; > 355 } > 356 > 357$message .= ' > 358>no > 359Answer "yes" if you want all postings to > the list to be > sent to > 360 a moderator for approval before distribution to the > list. > > Any help would be greatly appreciated. Thanks! > > Rob Day > Web Team Leader > Texas State Library and Archives Commission > phone: 512.936.4463 fax: 512.463.5436 > [EMAIL PROTECTED] > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] parse error
I've written a small script that processes a form from a webpage and sends the submitted data as an HTML e-mail that has the form all filled out already. I've gotten smaller versions of this script to work without any problem just to test the idea.I can't figure out why I'm now getting the following error: Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3 on line 358 Here is the offending code: 353 if ($moderation == "no"){ 354 $message .= " checked"; 355 } 356 357$message .= ' 358>no 359Answer "yes" if you want all postings to the list to be sent to 360 a moderator for approval before distribution to the list. Any help would be greatly appreciated. Thanks! Rob Day Web Team Leader Texas State Library and Archives Commission phone: 512.936.4463 fax: 512.463.5436 [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] parse-error MySQL - PhP @ win2000
Thanks very much for the assistence: The curly-bracket thing did it! Now I finally know the installation has been succesfull! I'll try to start programming less sloppy, and spare you from these silly errors! I'll notify you when the site is up and running. Future site location: www.hyperspectral.info J. ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! ** - Original Message - From: "Roel Mulder" <[EMAIL PROTECTED]> To: "Jelle Ferwerda" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, November 10, 2001 10:39 PM Subject: Re: [PHP-DB] parse-error MySQL - PhP @ win2000 > Dag Jelle, > Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou > het goed moeten gaan. > > Dus regel 24 wordt: print ($resultaat[0]); > > (Excuse me muttering Dutch between the two of us :) > > M.vr.gr. > Roel Mulder > > At 21:32 10-11-2001 +0100, you wrote: > >Hi all, > > > >I have recently installed an apache server, PhP4 and MySql on my win2000 > >machine (I know, I should be running linux; That will have to come with > >time). But now I am trying to learn PhP - MySQL. When running the script > >below I get the error message: > > > >Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 > > > > > >Is there anybody who knows what the problem might be? I think is in the > >result display part, considering how things run properly when I leave it > >out. Hopefully you ca get me going, since I do not know what I am doing wrong!! > > > >Thanks for the help, > > > >Jelle > > > > > > >$host="localhost"; > >$username=""; > >$password=""; > >$database="jelle_test"; > >$table="pet"; > > > > > >$db = mysql_connect($host) > > or die ("verbinding maken met de server is mislukt"); > >Echo "gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db"; > > > > @mysql_select_db($database, $db) > > or die ("Helaas geen verbinding kunnen maken met de database"); > > > >$sql_select = "Select * from pet"; > >$result = mysql_query($sql_select, $db); > >if($result) { > > echo "Selectie succesvol"; > > while ( $resultaat = mysql_fetch_row($result)) { > > printf($resultaat[0]); > >} > > > >mysql_close($db); > >?> > > > > > >-- > > > > > >** > >Ir. Jelle G. Ferwerda > >[EMAIL PROTECTED] - www.bio-vision.nl > > Mulder Technisch Advies > Postbus 69 > NL-2740 AB WADDINXVEEN > tel. 0182-640184 fax. 0182-640185 > http://www.mta.nl > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] parse-error MySQL - PhP @ win2000
Hi Jelle, - Original Message - I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle =an error message that quotes a line number AFTER the end of the script indicates that some entity has been opened but not closed. In this case curly brackets. =Various source code formatting conventions exist to try to avoid the situation (that we have here) where the appearance of the source code works to deceive brain and eye. There has been some debate in PHP forums about the 'best' way (FWIW my opinion: whatever works=best), and this is an excellent illustration of why coding the opening bracket of a code block this way, may not be "best" way! The code-block indentation is not consistent which further disguises the omission. =Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] parse-error MySQL - PhP @ win2000
Dag Jelle, Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou het goed moeten gaan. Dus regel 24 wordt: print ($resultaat[0]); (Excuse me muttering Dutch between the two of us :) M.vr.gr. Roel Mulder At 21:32 10-11-2001 +0100, you wrote: >Hi all, > >I have recently installed an apache server, PhP4 and MySql on my win2000 >machine (I know, I should be running linux; That will have to come with >time). But now I am trying to learn PhP - MySQL. When running the script >below I get the error message: > >Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 > > >Is there anybody who knows what the problem might be? I think is in the >result display part, considering how things run properly when I leave it >out. Hopefully you ca get me going, since I do not know what I am doing wrong!! > >Thanks for the help, > >Jelle > > >$host="localhost"; >$username=""; >$password=""; >$database="jelle_test"; >$table="pet"; > > >$db = mysql_connect($host) > or die ("verbinding maken met de server is mislukt"); >Echo "gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db"; > > @mysql_select_db($database, $db) > or die ("Helaas geen verbinding kunnen maken met de database"); > >$sql_select = "Select * from pet"; >$result = mysql_query($sql_select, $db); >if($result) { > echo "Selectie succesvol"; > while ( $resultaat = mysql_fetch_row($result)) { > printf($resultaat[0]); >} > >mysql_close($db); >?> > > >-- > > >** >Ir. Jelle G. Ferwerda >[EMAIL PROTECTED] - www.bio-vision.nl Mulder Technisch Advies Postbus 69 NL-2740 AB WADDINXVEEN tel. 0182-640184 fax. 0182-640185 http://www.mta.nl -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] parse-error MySQL - PhP @ win2000
Hi all, I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message: Parse error: parse error in c:\phpdev\www\public\test2.php on line 25 Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!! Thanks for the help, Jelle -- ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! ** ** Ir. Jelle G. Ferwerda [EMAIL PROTECTED] - www.bio-vision.nl ** Mankind: Intelligent enough to make a strong impact on the environment, But not strong enough to make an intelligent one! **
[PHP-DB] Parse error: parser stack overflow in...
... perm.inc on line 56 Hi all, this message some ppl get when they try to connect to a mysql database. i use php3 with phplib. the problem is, when i try it over lan and with dialin over isdn, there are no probs with win95, win98, winme and nt4.0 clients. neither with ms-ie nor with netscape. only a special combination with nt4.0 and ie5.0 or netscape4.5 seems to have this probs. so, whats going on? can a stack overflow beeing a result of the browser/operating-system?? any hint? thanks for answers chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] parse error
On Tue, Mar 13, 2001 at 07:56:31PM +0100, paauwe wrote: > what is a parse error? A simple search on dictionary.com came up with this definition for parse: Of fish, to have to remove the bones yourself. "I object to parsing fish", means "I don't want to get a whole fish, but a sliced one is okay". A 'parsed fish' has been deboned. There is some controversy over whether 'unparsed' should mean 'bony', or also mean `deboned'. With this knowledge, I feel it is safe to say that PHP is having a problem removing the bones from your fish. Perhaps you should sharpen your server's knife? A parse error is simply a syntax error. You probably forgot a closing ], ', ", `, ), ; or something similar. -- Jason Stechschulte [EMAIL PROTECTED] -- They can always run stderr through uniq. :-) -- Larry Wall in <[EMAIL PROTECTED]> ~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] parse error
what is a parse error?