I just updated my Xampp including PHP and MySQL to the latest versions. I imported my databases using phpmysql interface but when I open my website through localhost, the site loads ok and without errors but there is no database output in the page. It seems it is connected to the database but not accessing any data including login details.
Since you just loaded php to the latest version debugging it turned off, you’ll have to turn it back on in the php.ini. Then you will most likely see your errors…
I am pretty sure Debug is actually on as it did determine a fault in my log-in page or login success page which stated that the original code was no longer used in the current version,
" Fatal error: Call to undefined function session_is_registered() in C:\xampp\htdocs\ComputerSuperStore\success.php on line 4 "
so, it would be fair to assume that “IF” there was a problem it should find it, as it did with my success page… (I did look for the fix for the login success and found the solution original code:
session_start();
if(!session_is_registered(myusername)){
header(“location:index.php”);
}
new code:
session_start();
$_SESSION[‘myusername’]=$myusername;
{
header(“location:index.php”);
}
, it now works fine as it should. )
So yes I do believe the debugger was actually on, however I am open to suggestions I did look in php.ini file and checked it against the older version and it appeared the settings were the same, however yes i do see extra features/functions regarding de-bugging but reading through the file it does appear that is is set to on
If debugging is turned on, you can cause an error on purpose, leave a semi-colon off someplace. But their’s also levels of debugging…
Best thing to do is put this at the top of your page just below <?php to make sure.
[php]ini_set(‘display_errors’,1);
ini_set(‘display_startup_errors’,1);
error_reporting(-1);
[/php]
If you still get the blank page, then you should post the code that’s causing the blank page, maybe one of us will be able to identify what the issue might be.
I purposely broke the code and removed a ; and received an error message when I reloaded the page, so that part works.
I have a number of “includes” in the code which all work except one. this is directly after the query, however all of the includes “After” that section still work. In the past if there is an error in any of the code there will be an error messages somewhere even if most of the page working like if the query refers to somewhere not available like prod_table instead of prod-table, in the past the page will load but an error within the page will appear. The code block below is the part in question:
</div><!-- prod -->
<? include ('prodbot.php');?>
</div><!--mainbod-->
After this code, there are some closing “Div” tags and then a further “include” which does display, which sort of indicates that there are no “noticeable” errors all my pages have similar code and all have the same problem. When I am logged in I can view my account details so the site is actually able to pull data from the database. I have also tried substituting $result with $sql (as it is in my customer query code)
<?php $sql = mysql_query("SELECT * FROM customer WHERE UserName='" . $_SESSION['UserName'] . "' LIMIT 1"); while($row = mysql_fetch_assoc($sql)){ ?>Again no difference and no errors. Tried all that so I am at a loss really.
for the include tablelogincheck.php
<? //Checks to see if user is logged in if(!empty($_SESSION['UserName'])) $user = $_SESSION['UserName']; if (isset($_SESSION['UserName'])){ // Product Table for customer that has logged in (displays "add to cart" button) include ('tableli.php'); } else{ // Product Table for customer that is not logged in ("add to cart" button is not visible) include ('table.php'); } ?>I broke the above code and there were no errors displayed.
I removed the ; after the line $user = $_SESSION[‘UserName’]; no error displayed
I changed UserName to UserNam, no error displayed
So I as changing/breaking this code made no difference I can only assume the problem is before this code, that is is not actually being “included”??
Add the four lines below the underneath the mysql_query call.
The print_r should print out the entire data set if anything is returned.
[php] $result = mysql_query("SELECT * FROM products WHERE SpecFeat = ‘YES’ ") or trigger_error (mysql_error());
echo 'Displaying Results
';
print_r($result);
echo ‘
Results Displayed’;
exit;
[/php]
Thankyou for that but this used to display the content i wanted it to but now it doesn’t
tablei.php is
<?php echo ''.$row['Brand'].' | '; echo ''.$row['ModelVersion'].' | '; echo ''.$row['ShortDesc'].' | '; echo ''.$row['ImgM'].' | '; echo '$ '.$row['OurPrice'].' | '; echo ''.$row['Astr'].' | '; echo "
table.php is
<?php echo ''.$row['Brand'].' | '; echo ''.$row['ModelVersion'].' | '; echo ''.$row['ShortDesc'].' | '; echo ''.$row['ImgM'].' | '; echo '$ '.$row['OurPrice'].' | '; echo ''.$row['Astr'].' | '; echo "
I can only help you, if you do what I ask.
I did try your code and it displayed
Displaying Results
Resource id #10
Results Displayed
But no data, as it is not formatted though, it does change the appearance of the page, it removes the footer of my page i removed the exit; and page footer was visible, still no data displayed though.
Now do this… I changed 1 line.
[php]$result = mysql_query("SELECT * FROM products WHERE SpecFeat = ‘YES’ ") or trigger_error (mysql_error());
echo 'Displaying Results
';
print_r(mysql_fetch_assoc($result));
echo ‘
Results Displayed’;
exit;
[/php]
this displayed 1 item not formatted of course, however there are actually about 9 items that actually fit the search parameters, but it does actually display data
Displaying Results
Array ( [ProductId] => 17 [Brand] => Asus [Category] => Desktop Desktops All In One All In Ones [ModelVersion] => ET2700 [Item] => Desktop [ItemType] => All-In-One [FullDesc] => Windows 7 Professional 64 BitIntel Core i7-2600 CPU27" LED Backlit 1920 x 1080 (Non Touch)6GB Ram2TB [StockCount] => 12 [Astr] => * [OurPrice] => 2185.00 [SpecFeat] => YES [ShortDesc] => 27" All-In-One Desktop Computer Win 7 Pro [ImgM] => [Thumb] => )
Results Displayed
At the end of the day though, I am really amazed how simply updating Xampp/PHP/MySql would cause such a calamity.
It all worked fine in Xampp 1.7.7 and PHP 4.0.8… I have the earlier versions on my laptop and it all works fine…
i never had this much of a problem when updating in the past
Yeah mysql_fetch_assoc only returns 1 row, so at least we know you’re pulling back data from the database. That’s a good sign
I actually don’t see anything that will cause it not to display the data…
When it displays the blank page and you right click, view source? Do you see anything?
the display area is between
The source shows this between the tags: <? //Checks to see if user is logged in if(!empty($_SESSION['UserName'])) $user = $_SESSION['UserName']; if (isset($_SESSION['UserName'])){ // Product Table for customer that has logged in (displays "add to cart" button) include ('tableli.php'); } else{ // Product Table for customer that is not logged in ("add to cart" button is not visible) include ('table.php'); } ?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?><? //Checks to see if user is logged in
if(!empty($_SESSION['UserName']))
$user = $_SESSION['UserName'];
if (isset($_SESSION['UserName'])){
// Product Table for customer that has logged in (displays "add to cart" button)
include ('tableli.php');
}
else{
// Product Table for customer that is not logged in ("add to cart" button is not visible)
include ('table.php');
}
?>
so it seems there is a problem in the tablelogincheck.php ??
which is the actual code for the tablechecklogin.php
That’s not the HTML Source…
When you run it in the browser and the page is blank, right click on the browser and select view source.
UGGGHHHH >:( :o ??? I looked at the code in the tablechecklogin.php"
<? //Checks to see if user is logged in if(!empty($_SESSION['UserName'])) $user = $_SESSION['UserName']; if (isset($_SESSION['UserName'])){ // Product Table for customer that has logged in (displays "add to cart" button) include ('tableli.php'); } else{ // Product Table for customer that is not logged in ("add to cart" button is not visible) include ('table.php'); } ?>Changed the first <? to <?php and it looks like it may have fixed the problem
I feel like a bit of a dill now… something so damned simple
Yeah that’s a common issue, you have to turn on short tags in the PHP.ini to use the short tags.