kenteru Posted June 26, 2008 Share Posted June 26, 2008 I know when using PHP the system does not let you use " in the code unless in certain places. I have check the code where it says there is an error but it still says there is an error. Does anyone know if there is another type of error for T_STRING? I have only discovered the " T_STRING error so far. Here is what the error is and 3 lines of the code: <--The error--> Parse error: syntax error, unexpected T_STRING in XXmypageXX.php on line 14 <--The line and lines under and above--> $run[$cronName] = 1; mysql_query("UPDATE ghetto_cron SET last_run = '$today2' WHERE game = '$game' AND id = '$getMonthlyCron[id]'"); mysql_query(UPDATE ghetto_cron SET total_runs = total_runs + 1 WHERE game = $game AND id = $getMonthlyCron[id]); Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/ Share on other sites More sharing options...
.josh Posted June 26, 2008 Share Posted June 26, 2008 Well your 2nd query doesn't have quotes of any kind... Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575248 Share on other sites More sharing options...
kenteru Posted June 26, 2008 Author Share Posted June 26, 2008 I don't understand. I still don't know what to fix? Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575283 Share on other sites More sharing options...
wildteen88 Posted June 26, 2008 Share Posted June 26, 2008 When defining a query you need to wrap it in quotes. mysql_query("UPDATE ghetto_cron SET total_runs = total_runs + 1 WHERE game = '$game' AND id = '{$getMonthlyCron['id']}'"); Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575290 Share on other sites More sharing options...
kenteru Posted June 26, 2008 Author Share Posted June 26, 2008 I am not able to access it now. It is in its never-ending loading fit. Oh....I don't know what to do to fix it..... Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575470 Share on other sites More sharing options...
kenteru Posted June 26, 2008 Author Share Posted June 26, 2008 Oh and maybe by learning how to fix these errors it may fix the others. (It seemed to do that with other errors, some would be fixed because a higher one was fixed) Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/kentucom/public_html/index.php on line 12 Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575495 Share on other sites More sharing options...
kenteru Posted June 26, 2008 Author Share Posted June 26, 2008 Oh and this is the line: while ($getUpdates = 'mysql_fetch_array($findUpdates)') Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575496 Share on other sites More sharing options...
.josh Posted June 26, 2008 Share Posted June 26, 2008 remove the single quotes while ($getUpdates = mysql_fetch_array($findUpdates)) { putting single quotes around that causes you to assign a literally interpreted string to $getUpdates, and as long as php successfully assigns it (which there's really no way it won't fail to assign it unless some meteor crashes into the server or something), your loop will always be true and you'll have an infinite loop. Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575507 Share on other sites More sharing options...
kenteru Posted June 26, 2008 Author Share Posted June 26, 2008 I figured it out. On some codes you know how it wants two equal signs? Well the way the code was placed it wanted two equal signs! I GOT IT!!! YAY!! EX: mysql_XXcallXX(Space and equals!) == "Stuff that is what the call needs" Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575513 Share on other sites More sharing options...
.josh Posted June 26, 2008 Share Posted June 26, 2008 okay well I really have no idea what you're talking about because every time you post you have some new piece of code and it seems like you're on an entirely different issue... but anyways, the difference between = and == is that = is an assignment operator, as in you want to assign something to a variable. == is a condition operator, as in, you want to compare two things. Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575517 Share on other sites More sharing options...
kenteru Posted June 26, 2008 Author Share Posted June 26, 2008 Sorry. I fixed it though. Although I can't login. ' Quote Link to comment https://forums.phpfreaks.com/topic/112064-t_string-error-can-not-find-the-error/#findComment-575523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.