Jump to content

Ok this wont display anything even tho it should.


Dethman

Recommended Posts

hey guys there is no error but it wont display anything :S , Can't figure out why.

 

here is the function code:

 

<?php
function showCatigories(){
//Global Call For $rowsPerPage
global $rowsPerPage;
//Query Var:
$q="SELECT * FROM `GLASS_CATIGORIES` ORDER BY `id` ASC LIMIT $rowsPerPage";
//Query""
$v=mysql_query($q) or die("Unable to Select All From C-MORE-GLASS_CATIGORIES And Ascend".mysql_error());
$row=mysql_fetch_array($v);
$count=mysql_num_rows($v);
if($count==0){
	$catigories=("<div class='black-box'><td colspan=4 align=center><b><i>There are no Catigories Added to the System Yet. Try back at a later time</b></i></td></div>");
}
else{
 while($row=mysql_fetch_array($v)){
	$catigories=("
		<div class='black-box'>
				<h2><em>".$row['name']."</em> collection</h2>
				<p><img src='img/src/".$row['src']."' width='120' height='105' alt='Pic ".$row['id']."' /></p>
				<p>".$row['info']."</p>
				<p class='more'><a href='index.php?page=".$row['page']."'>More</a></p>
			</div>
	");
	  }
	}
return $catigories;
}
?>

 

 

Here is the call:

 

<?php
$catagorie=showCatigories();
?>

 

 

Thanx for any help, but it would be nice to have some help soon :D

 

Dethman AKA Brian Flores CEO of NimbusGames,llc

 

PS:

 

I put stuff in the Table so it should display something atleast.

 

Thanx Again

 

Link to comment
Share on other sites

OK, not to be mean, but there are no echo's or print calls, so why would anything be written tot he page. The function only create a variable and returns it. But, your call to the function only assignes the value to another variable and does not write it ot the page.

 

Try changing your function call to

<?php
echo showCatigories();
?>

 

EDIT: By the way, it should be spelled "catagories".

Link to comment
Share on other sites

1.) You should be using the .= operator, not =, to append to $catagories. You should also create the variable as an empty string prior to this to prevent an undefined variable notice.

 

2.) Nothing is displayed? What does that mean? Completely blank page? Did you check the source?

Link to comment
Share on other sites

Ok thanx deth that worked once I put $rowsPerPage=8; inside the function so now its giving me an SQL error lol

 

here is the SQL Error:

 

Unable to Select All From C-MORE-GLASS_CATIGORIES And Ascend:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Query Line:

 

<?php
$q="SELECT * FROM `GLASS_CATIGORIES` ORDER BY `id` ASC LIMIT $rowsPerPage";
?>

Link to comment
Share on other sites

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.