nicoscodes Posted June 20, 2013 Share Posted June 20, 2013 (edited) Hey guys,Nothing is showing up, just getting a blank white page, any suggestions? <?php include("include/konnect.php"); $sql=mysql_query("SELECT * FROM ask"); while($row=mysql_fetch_array($sql)) { $msg=$row['msg']; $mes_id=$row['mes_id']; $up=$row['up']; $down=$row['down']; echo " <div id='main'> <div class='box1'> <div class='up'><a href='' class='vote' id='".$mes_id."' title='Up' name='up'>".$up."</a></div> <div class='down'><a href='' class='vote' id='".$mes_id."' title='Down' name='down'>".$down."</a></div> </div> <div class='box2' > ".$msg." <br><br><div class='fb-comments' data-href='http://example.com/page.php?id=".$mes_id."' data-num-posts='2'></div><br><br> "; } ?> Edited June 20, 2013 by nicoscodes Quote Link to comment Share on other sites More sharing options...
boompa Posted June 20, 2013 Share Posted June 20, 2013 Either your query is failing (you don't check), the query's not returning any rows, or you have a syntax error. Quote Link to comment Share on other sites More sharing options...
nicoscodes Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) Locally It's working fine. Is there any error in the above code? Is the version of PHP on the server not supproting this? My text editor is saying i have zero synatax errors? Edited June 20, 2013 by nicoscodes Quote Link to comment Share on other sites More sharing options...
boompa Posted June 20, 2013 Share Posted June 20, 2013 (edited) $sql=mysql_query("SELECT * FROM ask") or die("MySQL Failure: " . mysql_error()); if (mysql_num_rows($sql) == 0) die("There were no rows returned"); while($row=mysql_fetch_array($sql)) Add that to your code and what do you find? Edited June 20, 2013 by boompa Quote Link to comment Share on other sites More sharing options...
nicoscodes Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) Still coming up blank, nothing showing. In my php error log I am getting: Call to undefined function phpinclude() Edited June 20, 2013 by nicoscodes Quote Link to comment Share on other sites More sharing options...
boompa Posted June 20, 2013 Share Posted June 20, 2013 Somewhere, maybe in your "include/konnect.php" file, you have phpinclude() instead of just include(). Quote Link to comment Share on other sites More sharing options...
nicoscodes Posted June 20, 2013 Author Share Posted June 20, 2013 The konnect.php file contains database connection (not using PDO): <?php $conn = mysql_connect('localhost', 'user', 'pass') or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('data',$conn) or trigger_error("SQL", E_USER_ERROR); mysql_set_charset('utf8',$conn); ?> I have been troube shooting but cannot find where this error is coming from, would it be the host? the host supports PHP5 and I running locally on MAMP with no issues. I appreciate your help and thanks, what is my next course of action is the error log is giving me: Call to undefined function phpinclude() Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted June 20, 2013 Share Posted June 20, 2013 it would have been helpful if you included the file name and line number information from the logged error message. however, its likely that your new-line character(s) from your development system are not being recognized and your source code is being interpreted as <?phpinclude(...); what operating system is the live server using? Quote Link to comment Share on other sites More sharing options...
nicoscodes Posted June 20, 2013 Author Share Posted June 20, 2013 Running linux, PHP version 5.2.17 error is line 1 where there is no PHP code. Quote Link to comment Share on other sites More sharing options...
boompa Posted June 20, 2013 Share Posted June 20, 2013 What editor are you using on your Mac to create the PHP files? Quote Link to comment Share on other sites More sharing options...
Solution mac_gyver Posted June 20, 2013 Solution Share Posted June 20, 2013 your file probably has just lf (line-feed) characters for new lines from being on a Mac save you file with cr (carriage-return) or crlf (carriage-return/line-feed) new line characters and they should be seen by the live server. Quote Link to comment Share on other sites More sharing options...
nicoscodes Posted June 20, 2013 Author Share Posted June 20, 2013 I have spent the last 3 weeks practically going insane. I have pretty much given myself anuerisms and had countless sleepless nights. 3 clients websites have been down and not functional because of this carriage return.You are a fucking god and I want to thank you so much. Quote Link to comment 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.