![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnox/htmHello,
I am slowly learning to use PHP for the website that I am putting together. So, please understand that I am a newbee to PHP, and MySql. I am also creating this script from other bits and pieces from other scripts, so that might be part of my problem. What I am attempting to accomplish here, is to update a variable by adding one to it, and then sending it back to the database to be updated there, before going to the website that the user selected. This is the error that I am getting... Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnox/html/ace.php on line 43 This is my script: PHP Code:
I used to have a few echo statements in this script to verify that certain aspects of the script worked. But, as soon as I added the Line 43 portion, then the script stopped working, and gave me the errors listed. Thanks for any help, Richard Last edited by LuciWiz : 19-Nov-2006 at 08:46.
Reason: Please insert your Php code between [php] & [/php] tags
|
|||
|
#2
|
||||
|
||||
Re: Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnox/htmMissing the quotes for the string. Change that line to look like this:
PHP Code:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnoxGreat, that corrected the error. But now that I finished the rest of the coding. I am seeing that it is not updating the database.
I am trying to update a record by locating it in the database with a unique 'ID' number, and placing the update into the 'viewed' location. --> viewed <--- is the name of the field in the database that I am wanting to update. Here is the code again. PHP Code:
Last edited by LuciWiz : 19-Nov-2006 at 08:46.
Reason: Please insert your Php code between [php] & [/php] tags
|
|
#4
|
||||
|
||||
Re: Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnox/htmWhere is $viewed set? Does $id have a value?
Try placing an echo after each one to see if you get a value, for example: PHP Code:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#5
|
|||
|
|||
Re: Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnoxhttp://www.thisismywebsite.net/ace.php?id=1
ID is set from above, when through the link. viewed is the field from inside the database, and I want to increment it by one. I have been placing echo within the script, I just have been removing them to prevent confusion. Here is the complete script. PHP Code:
I had placed echo in a couple of areas to see that I am retrieving data, and updating the viewed count. But, I am uncertain why I am not updating the count in the database. Richard PS: Here is the output. I know that its not formated and pretty. I was just looking to see that it was updating. First Viewed: 0Name: Soo Locks Cam 1ID#: 1Link: https://webcam.crrel.usace.army.mil/soo/Viewed: 0Viewed: 1Second Viewed: 1Viewed: 1ID: 1 Last edited by LuciWiz : 19-Nov-2006 at 08:47.
Reason: Please insert your Php code between [php] & [/php] tags
|
|
#6
|
|||
|
|||
Re: Parse error: parse error, unexpected T_STRING in /home/content/R/i/c/RichardAKnox/htmI figured it out.
I changed this: $query = "UPDATE wcdatabase SET viewed = $viewed where id = $id"; to this: $query = "UPDATE wcdatabase SET viewed = ($viewed) where id = ($id)"; And it started to work. Thanks for the help. Richard |
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parse error: parse error, unexpected T_STRING | Richardknox | PHP Code Library | 3 | 19-May-2007 14:42 |
| Apologies In Advance Parse error: parse error, unexpected T_STRING, expecting T_VARI | sph2005 | MySQL / PHP Forum | 11 | 17-Jul-2006 09:28 |
| Parse Error | vigilantweather | MySQL / PHP Forum | 3 | 21-Feb-2006 12:24 |
| Parse Error | vigilantweather | MySQL / PHP Forum | 6 | 04-Feb-2006 13:15 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The