TRI0N Posted December 19, 2012 Share Posted December 19, 2012 Hey all I just replaced all our main gateways that house all our LAN based office PHP Apps I have made and the issue is that database parsing is not working like they did on the older systems. I currenly have PHP 5.3.3 and MySQL 5.1.66 and the code is outputting this on the screen rather then the $row[x] from the database. I'm sure this is a simple fix in the configuration somewhere to get these pages working again on the new setup. Annual Discount Card Purchases: '.$row[2].', '.$row[1].' ' ; } // Close Database Connection mysql_close(); ?> Gift Certificate Purchases: '.$row[1].' :: '.$row[12].' :: '.$row[13].' :: '.$row[14].' ' ; } // Close Database Connection mysql_close(); ?> Any help getting this to parse the data correcly and not print my code would be excellent. Remember nothing about the old working code has changes this is simple running the old PHP files on MUCH newer PHP and MySQL Versions. Best regards, TRI0N! Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/ Share on other sites More sharing options...
TOA Posted December 19, 2012 Share Posted December 19, 2012 (edited) I am NOT a server guy, so I don't think I can offer much help, sorry, but that seems like your php isn't set up or is set up incorrectly. Edited December 19, 2012 by TOA Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400408 Share on other sites More sharing options...
TRI0N Posted December 19, 2012 Author Share Posted December 19, 2012 Actually it's setup correctly just securly with alot of things disabled. I'm sure it's just a simple setting to get this going again. Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400411 Share on other sites More sharing options...
PFMaBiSmAd Posted December 19, 2012 Share Posted December 19, 2012 What does the opening php tag(s) look like? Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400420 Share on other sites More sharing options...
TRI0N Posted December 19, 2012 Author Share Posted December 19, 2012 Here is what the PHP code looks like that outputs the above into the page when viewed: <? // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname3") ; // Check Events in Events Database $result1 = mysql_query("select distinct * from cdc_sales WHERE processed = '0'") ; while($row = mysql_fetch_row($result1)) { echo '<a href="purchase_details.php?id='.$row[0].'">'.$row[2].', '.$row[1].'</a><br>' ; } // Close Database Connection mysql_close(); ?> </td> </tr> <tr> <td> </td> </tr> <tr> <td>Gift Certificate Purchases:</td> </tr> <tr> <td> <? // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname3") ; // Check Events in Events Database $result2 = mysql_query("select distinct * from gift_certs WHERE processed = '0'") ; while($row = mysql_fetch_row($result2)) { echo '<a href="purchase_gc_details.php?id='.$row[0].'">'.$row[1].' :: '.$row[12].' :: '.$row[13].' :: '.$row[14].'</a><br>' ; } // Close Database Connection mysql_close(); ?> Best regards, TRI0N Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400425 Share on other sites More sharing options...
Christian F. Posted December 19, 2012 Share Posted December 19, 2012 (edited) If you check the source of that page, I'm willing to bet that you'll see the PHP code. Which means the PHP parser haven't been executed, and the web server (if the file has been fetched through it) has treated the file as pure HTML. This is normally either because of an incorrect configuration of the server, failure to restart it after setting up PHP, or forgetting to set the file extension to "php". Edit, added: Or using short tags when they're disabled. Replace them with the full <?php tags. Edited December 19, 2012 by Christian F. Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400426 Share on other sites More sharing options...
PFMaBiSmAd Posted December 19, 2012 Share Posted December 19, 2012 Try full opening php tags <?php Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400428 Share on other sites More sharing options...
TRI0N Posted December 19, 2012 Author Share Posted December 19, 2012 If what you think is a setting in php.ini then point me to it. But the above didn't help much and any changes to things I always run service httpd restart. Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400432 Share on other sites More sharing options...
TRI0N Posted December 19, 2012 Author Share Posted December 19, 2012 Yep that was it.. php.ini is setup for strict PHP and the Tags where the reason. Good reason to. I will just go back into my work and make sure all tags are pressent. Thanks a ton PFMaBiSmAd! I knew my php setup was good and very secured so missing the tags threw me off. Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400438 Share on other sites More sharing options...
PFMaBiSmAd Posted December 19, 2012 Share Posted December 19, 2012 (edited) You have to find the cause of the problem before you can fix it. Otherwise you just waste a bunch of time. By trying full opening php tags in that code, it will confirm if that is the cause of the problem. Edit: never mind, you posted while I was writing this and the forum's post notification is a -10 likes. Edited December 19, 2012 by PFMaBiSmAd Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400441 Share on other sites More sharing options...
TRI0N Posted December 19, 2012 Author Share Posted December 19, 2012 Yep and now with the Full Opening Tags the data is parshing just as it should. Thanks.. Oh and I was refering to other help as not being helpful. Yours help was right on the money. Quote Link to comment https://forums.phpfreaks.com/topic/272194-phpmysql-new-server-help-asap/#findComment-1400444 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.