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=...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
<?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"; } ?> |
|
|||
|
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) |
|
|||
|
"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. |