Forum Moderators: coopster

Message Too Old, No Replies

Invalid T_STRING in print statement?

HTML causing error in PHP page.

         

dbzfyam

3:55 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



I'm working on a small script but when I tried to spice it up a bit with css and a table, I got a T_STRING error on this line:

PRINT "<table class=\"onder\" width=\"199\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr align=\"center\" bgcolor=\"white\"><td class=\"boven\" colspan=\"2\" bgcolor=\"#5d5d5d\">Database geupdate:</td></tr><tr><td bgcolor=\"#5d5d5d\"></td><td bgcolor=\"#5d5d5d\"></td></tr><tr align=\"center\" bgcolor=\"#af2828\"><td align=\"center\" bgcolor=\"#838383\">Dag:</td><td align=\"center\" bgcolor=\"#838383\">$dag</td></tr><tr><td align=\"center\" bgcolor=\"#838383\">Begintijd:</td><td align=\"center\" bgcolor=\"#838383\">$begintijd</td></tr><tr><td align=\"center\" bgcolor=\"#838383\">Eindtijd:</td><td align=\"center\" bgcolor=\"#838383\">$eindtijd</td></tr><tr><td align=\"center\" bgcolor=\"#838383\">Programma:</td><td align=\"center\" bgcolor=\"#838383\">$programma</td></tr><tr><td align=\"center\" bgcolor=\"#838383\"></td><td align=\"center\" bgcolor=\"#838383\"></td></tr><tr><td colspan=\"2\" align=\"center\" bgcolor=\"#838383\"><a href=\"javascript:history.go(-1)\">Terug</a></td></tr></table>";

Can anyone tell me what the problem is?

Thank you very much,
Stefan.

jatar_k

4:06 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I am betting mismatched quotes or a set of unescaped quotes, time to start counting ;)

dbzfyam

4:20 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



Maybe I'll just keep with plain text ;). Anyway, I have one more question: I have different tables (one for each day) and 4 columns (id, begintijd, eindtijd, programma). I made a script to put data into those tables (this script is for a tv channel), but I don't know how to automatically display the contents of the database (so first the starting time (begintijd), then the end-time (eindtijd) en at last the programs name (programma)). Can you tell me how to do this? I can't find a good tutorial anywhere.

Thanks,
Stefan

jatar_k

5:52 pm on Jun 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> Maybe I'll just keep with plain text

hehe, might be an idea, I don't see any vars in there anyway so you could just jump out of php and back in

>> mysql

maybe try this one
Basics of extracting data from MySQL using PHP [webmasterworld.com]

dbzfyam

6:15 pm on Jun 21, 2005 (gmt 0)

10+ Year Member



I got it working now for some reason (the first question). I replaced $dag etc with {$dag} and it worked (Couldn't jump out of PHP since it mixed up two tables for some reason when I tried. I added the other part of the table in a while loop).. Thanks for the link by the way. I did have the right commands to get everything in a table, but I accidently used SORT ON instead of SORT BY. So the script didn't work. The script is finally completed now (47kb in total...). Thank you very much for the help!