Jump to content

Nothing showing, what am I doing wrong here?


Go to solution Solved by mac_gyver,

Recommended Posts

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 by nicoscodes
$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 by boompa

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()

 

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?

  • Solution

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.