Bluehost.com Web Hosting $6.95

What's Wrong with my Script?

This is a discussion on What's Wrong with my Script? within the PHP Language forums, part of the PHP Programming Forums category; <?php include"dbconn.php"; $db=mysql_select_db(creative_Articles,$connection) ; $Parent="SELECT DISTINCT 'Cat_Parent' FROM Category"; $mysql_Parent=...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-05-2006
funkychicken818@gmail.com
 
Posts: n/a
Default What's Wrong with my Script?

<?php
include"dbconn.php";
$db=mysql_select_db(creative_Articles,$connection) ;

$Parent="SELECT DISTINCT 'Cat_Parent' FROM Category";

$mysql_Parent=mysql_query($Parent);

while ($row=mysql_fetch_array($mysql_Parent))
{
$Cat_Parent=$row["Cat_Parent"];

echo "$Cat_Parent";
}
?>

Reply With Quote
  #2 (permalink)  
Old 05-05-2006
Tom Thackrey
 
Posts: n/a
Default Re: What's Wrong with my Script?



On 4-May-2006, "funkychicken818@gmail.com" <funkychicken818@gmail.com>
wrote:

> $Parent="SELECT DISTINCT 'Cat_Parent' FROM Category";


Looks like the wrong kind of ticks around the column name it should be
`Cat_Parent`
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
Reply With Quote
  #3 (permalink)  
Old 05-05-2006
Tim Roberts
 
Posts: n/a
Default Re: What's Wrong with my Script?

"funkychicken818@gmail.com" <funkychicken818@gmail.com> wrote:

><?php
> include"dbconn.php";
> $db=mysql_select_db(creative_Articles,$connection) ;


Is creative_Articles the name of the database? If so then you want it to
be in quotes.

> $Parent="SELECT DISTINCT 'Cat_Parent' FROM Category";


If Cat_Parent is a column name, you probably don't want the single quotes
in there. You're selecting the constant string "Cat_Parent", not the
column named Cat_Parent.

> $mysql_Parent=mysql_query($Parent);
> while ($row=mysql_fetch_array($mysql_Parent))
> {
> $Cat_Parent=$row["Cat_Parent"];
> echo "$Cat_Parent";
> }
> ?>


The rest looks OK.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Reply With Quote
  #4 (permalink)  
Old 05-07-2006
funkychicken818@gmail.com
 
Posts: n/a
Default Re: What's Wrong with my Script?

thanks i got it to work

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:48 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0