Jump to content

blacknight

Members
  • Posts

    271
  • Joined

  • Last visited

Posts posted by blacknight

  1. add

    echo $cid. ' - '.$catname.' - '.$catdesc. ' - ' .(bool)$ok;

    after your global statement and see if the values are even passing to the function... and if youa re getting a sql error post it please

  2. drop the

    $stmt = $db->stmt_init();          
    $stmt = $db->prepare("UPDATE category SET catname=?,catdesc=? WHERE cid=?");          
    $stmt->bind_param('ssi',$catname,$catdesc,$cid);         
    $stmt->execute();            
    $stmt->close();  

    and just use a normal sql update string....

     

    $result = $db->query("UPDATE `category` SET `catname`='$catname',`catdesc`='$catdesc' WHERE `cid`='$cid'");

     

    only thing i can sujest because you dident post the $stmt function file ... but that seems like a lota work for an update ...

  3. $db = mysql_connect(__CFG_HOSTNAME, __CFG_USERNAME, __CFG_PASSWORD, TRUE, MYSQL_CLIENT_INTERACTIVE) or die(mysql_error());
    mysql_query("SET SESSION interactive_timeout=120", $db);
    mysql_select_db(__CFG_DATABASE, $db);

     

    this would set the connection to time outa fter 120 seconds

  4. function Auth()
    {
    if (($_SESSION['uname']) && ($_SESSION['access'] == 2)) {
    #if already logged in, redirect based on dept id
    if ($_SESSION['dept'] == 1) {
    header("Location: admin/index.php");
    } elseif ($_SESSION['dept'] != 1) {
    header("Location: cases/cases-list.php"); } 
    else {
    // If access is not GRANTED then reset and hold user at login page
      unset($_SESSION['uname']);
      unset($_SESSION['access']);
      header("Location: index.php"); }
    }
    }
    

     

    then call Auth(); at the top of all your pages

  5. opps yea i see that now too some one shouldent be the sender and the reciver at the same time which is what the on statement is stating

    if you use ON (gold_logs.to_id = ibf_members.id OR gold_logs.from_id = ibf_members.id) it will list both sent and recived

     

  6. once you left join you have to declare each table each field is from

    im guessing form_id and to_id are in gold_logs

     

    SELECT gold_logs.*,name,star 
    FROM gold_logs 
    LEFT JOIN ibf_members 
    ON (gold_logs.to_id = ibf_members.id AND gold_logs.from_id = ibf_members.id)
    WHERE gold_logs.to_id = 1
    

     

    and see if that works..

  7. if (isset($_GET('what_page')
    {
    $what_page = int() $_GET('what_page');
    if($what_page>3 OR $what_page<0)
    {         
    	what_page=0;       
    
    }
    }

     

    should be all the code you need at the top after your array your else statement was allways setting your page to 0by not setting a else you let $what_page stay set if it passes the fail check

  8. ever think of using a table?

    
    $html = '<table><tr>';
    $cols = 3;// can be any size you want
    $x = 0;
    while ($row = mysql_fetch_array($sql)) 
    {
    $x++;
    $reference = $row['reference'];
    $image = $row['image'];
    $html .= '<td>';
    $html .= '<p><img src="./images/cakes/'.$image.'" height="289px" width="177px" alt="IMAGE OF CAKE"></img><br />';
    $html .= '<b>Reference:</b>'.$reference.'.</p>';
    $html .= '</td>';
    if ($x == $cols)
    {
    	$html .= '</tr><tr>';
    	$x=0;
    }
    }
    
    if (!$reference) 
    {
    $html .= '<td>There are no cakes in this category yet.</td>';
    }
    echo $html;

×
×
  • 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.