"Blonde" question about making posts using PHP

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

Moderator: General Moderators

User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: "Blonde" question about making posts using PHP

Post by jaoudestudios »

I dont think that will be it, as php is happy to have 2 echos on one line as long as there is a semi colon separating the 2 lines of code.

Worth a try though, let us know.

PHP is very forgiving, try Actionscript 3! :)
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Re: "Blonde" question about making posts using PHP

Post by Stryks »

Yeah .... these problems can be a pain to see ... but the problem isn't the separation of the lines ... it's in this bit.

Code: Select all

$row['Time2];
 
 
The missing single quote makes PHP see something like ...

Code: Select all

'Time2]; echo "</font><br><font color='
... as the array index, so that semicolon is never seen, and because the closing array bracket never gets found it just continues along until it finds the next parsable command, which happens to be the echo on the next line.

At least, that's the way I visualize it when I come across these issues.

But I'd be interested to know if it does actually fix the issue.

Cheers.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: "Blonde" question about making posts using PHP

Post by jaoudestudios »

Sorry I did not realise there was a missing quote. Yes that will be the problem! Well spotted :)
phpnewbie3
Forum Newbie
Posts: 17
Joined: Sat Sep 20, 2008 10:15 am
Location: NJ, USA

Re: "Blonde" question about making posts using PHP

Post by phpnewbie3 »

Thanks Stryks!
Of course everything works now!

If I knew we have to look in the previous line for error not in the one what it says in the error message that would've been spared tons of time to me.
Funny thing is though that when I looked at your first post where you did not shown that specific bit of the line where the ' was missing, I needed to look about 30 secs to realize what is missing. My first reaction was that nothing's missing, lol...

Anyways, now I got a crazy taste to become advanced in time in PHP.
It's just too useful for someone who likes to build his own sites.
Post Reply