Jump to content

phpworker

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by phpworker

  1. Hi

    In the following code,at the 21st  line, the code to print the  value of the variable $cartContent  is:

    print_r ($cartContent);

    function getCartContent()
    {
    $cartContent = array();
    
    $sid = session_id();
    $sql = "SELECT ct_id, ct.pd_id, ct_qty, pd_name, pd_price, pd_thumbnail, pd.cat_id
    		FROM tbl_cart ct, tbl_product pd, tbl_category cat
    		WHERE ct_session_id = '$sid' AND ct.pd_id = pd.pd_id AND cat.cat_id = pd.cat_id";
    
    $result = dbQuery($sql);
    
    while ($row = dbFetchAssoc($result)) {
    	if ($row['pd_thumbnail']) {
    		$row['pd_thumbnail'] = WEB_ROOT . 'images/product/' . $row['pd_thumbnail'];
    	} else {
    		$row['pd_thumbnail'] = WEB_ROOT . 'images/no-image-small.png';
    	}
    	$cartContent[] = $row;
    }
             
            print_r ($cartContent);	
    return $cartContent;
    }

     

    I get the output at runtime as,

    Array ( [0] => Array ( [ct_id] => 120 [pd_id] => 22 [ct_qty] => 4 [pd_name] => volvo1 [pd_price] => 100.00 [pd_thumbnail] => /plaincart/images/no-image-small.png [cat_id] => 14 ) )

     

    When i want to see only the ct_id key and its value which is 120,ignoring all other keys and values.

    what is the code for it..

     

    thanks

    phpworker

  2. hi

    i am new to phpreaks and want a clarification

    Before posting my topic ,i saw three options at the right top of the table as -New topic,Notify,Mark Read.

     

    What is use of notify and mark read option.How to do that..

     

    I want to book mark or record the answer by your side for my posting questions..How can i do that..?

     

    thanks

    karthika

  3. Hi

    if (isset($_GET['p']) && (int)$_GET['p'] > 0) {
    $pdId = (int)$_GET['p'];
    $sql = "SELECT pd_name
    		FROM tbl_product
    		WHERE pd_id = $pdId";
    
    $result    = dbQuery($sql);
    $row       = dbFetchAssoc($result);
    $pageTitle = $row['pd_name'];
    
    }

     

    In the above coding,what is the code for seeing the output of the variable $sql,$result,$row

    at runtime of the application..

     

    Is it echo $result or print ($result) or any other...?

     

    thanks

    phpworker

     

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