php query cant figure out the problem

Posted by Eat on Stack Overflow See other posts from Stack Overflow or by Eat
Published on 2011-01-13T02:29:45Z Indexed on 2011/01/13 2:53 UTC
Read the original article Hit count: 178

Filed under:
|
|

I dont get an error but it does not return me the row values as well. How can I address the problem?

<?php 

    //DATABASE
    $dbConn     =   mysql_connect($host,$username,$password);
    mysql_select_db($database,$dbConn);

    $SQL =  mysql_query("SELECT N.*, C.CatID FROM News N INNER JOIN Categories C ON N.CatID = C.CatID WHERE N.Active = 1 ORDER BY DateEntered DESC");


    while ( $Result = mysql_fetch_array($SQL) or die(mysql_error())) {
    $CatID[] = $Result[CatID];
    $NewsName[] = $Result[NewsName];
    $NewsShortDesc[] = $Result[NewsShortDesc];
    }

//  mysql_free_result($Result);


?>
                <div class="toparticle">
                    <span class="section"><?=$CatID[0] ?> </span>
                    <span class="headline"><?=$NewsName[0] ?></span>
                    <p><?=$NewsShortDesc[0] ?></p>
                </div>

© Stack Overflow or respective owner

Related posts about php

Related posts about sql