When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3"
it's give me an error
here is :
"
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:wampwwwarticlemaniacategory.php on line 42"
here is my code:
Line number On/Off | Expand/Contract<?php include("inc/connection.php");include_once("inc/functions.php");$cat_id = $_GET['cid'];$select_page_title = ("SELECT cat_name FROM category WHERE cat_id = '$cat_id'");$querying_page_title = mysql_query($select_page_title);$fetching_page_title = mysql_fetch_assoc($querying_page_title);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title><?php echo "Article Mania - {$fetching_page_title['cat_name']}"; ?></title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="inc/style.css" rel="stylesheet" type="text/css"></head><body><table border="0" align="center" cellpadding="0" cellspacing="0"><tr><td valign="top"><?php include("inc/header.php"); ?> </td></tr></table><table border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="left" valign="top"><?php include("inc/left.php"); ?> </td><!-- Main Conent Area Start here --><td align="left" valign="top"><table width="506" border="0" align="center" cellpadding="0" cellspacing="0"><tr> <td valign="top"><?php echo "------> {$fetching_page_title['cat_name']}"; ?><br /><img src="inc/images/main_content_area.gif" alt="main content" width="506" height="33"></td></tr><tr> <td class="mcbg"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> <td width="1"> </td><td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><?phpif(intval($cat_id) <= 0 && is_string($cat_id)){ common_error("Invalid category specified"); exit(); } else { $select_article_indivisual = ("SELECT * FROM article where cat_id = "$cat_id" ORDER BY article_id DESC"); $querying_article_indivisual = mysql_query($select_article_indivisual); $select_article_indivisual_rows = mysql_num_rows($querying_article_indivisual); if($select_article_indivisual_rows <= 0){ common_error("No article available at this time"); exit(); } else { while($retrieve_article_indivisual = mysql_fetch_assoc($querying_article_indivisual)){echo "<tr> <td bgcolor="#E8E8E8" class="style2"><font size="2" face="Arial, Verdana, Helvetica, sans-serif"><a href="article.php?aid=$retrieve_article_indivisual[article_id]" alt="$retrieve_article_indivisual[article_title]"><b><u>$retrieve_article_indivisual[article_title]</u></b></a></font></td></tr><tr> <td><font face="Arial, Verdana, Helvetica, sans-serif" size="2"><br />".shortstring($retrieve_article_indivisual['article_text'])."<br /></font></td></tr><tr> <td><font size="1"> </font></td></tr><tr><td bgcolor="#E8E8E8"><span class="style2"><hr><font size="2" face="Arial, Verdana, Helvetica, sans-serif"><b>Posted Date: $retrieve_article_indivisual[article_date] | Category: <a href="category.php?cid=$retrieve_article_indivisual[cat_id]" alt="$retrieve_article_indivisual[cat_name]">".ucwords($retrieve_article_indivisual['cat_name'])."</a></b></font></span><br /><hr></td></tr>"; } } }?><!-- Copyright start Here<tr><td class="crbg"><div align="center"><font size="1">© 2005 - <strong><a href="http://www.zymic.com"><font color="#208226">Free Templates</font></a> <font color="#00F43E"><a href="http://www.zymic.com">By <font color="#208226">Zymic.com</font></a></font></strong> - Content by your <strong>site name</strong> - 100% Valid HTML 4.01 Transitional!</font></div></td></tr> --> </table></td><!-- Main Content Area end here --></tr></table></body></html>
printing links
Hi every1i am connecting to a table in sql and the looping through with a while ($ var = my sql fetch array)the question i have is that when i print_r($var)i get the associative array of all elements
user administration
Dear @all,
Typedef struct vs just struct
Anyone know the rationale for using typedef for structs when a struct is itself a typedef? I have seen this in just about every book I have ever read, never with any explanation, yet I know from
Problem with HTTP Caching...?
Hi there, im trying to implement caching. But it doesn't always work.I post it here because there is no Client-Side HTTP topic...Code: private function setLastModified ($aTimestamp) {
values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a database. the form submits some data to one table, and other data to another table. my problem is that
The IE or FF detector
Hello Friends,Problem of today ( we seek for php help ) as following ,we know all that PNG images not shown well on IE6 and some "css'ers" given us a solution --> fine 1but if that
FILTER_CALLBACK -- Files?
Hi All,I'm using the php filter functions to validate my form data. For custom filters, I'm using the FILTER_CALLBACK filter but when I'm using files, this never seems to be called? It may be that the
Floating Point Precision Loss
I'm writing a program to draw a three-dimensional cube (with a corner cut off) without using any 3D graphics APIs. The only API call I make is win32's SetPixel()
Validation
Hello I know this is a really vag question.I need to have a input field on a form that only submit's if the text inserted starts with any two letters and any four numbers
Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment that have 5 clients and 1 server. To do so, I need to be able to edit IP header to change it's