Re: Problem wkith Query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Turn on error reporting/logging/displaying and what errors are you getting?

And as you said ...

$result10 = mysqli_query($cxn, $sql10);
        var_dump($result1); // this returns NULL

is your actual code, maybe ...

<?php
$a = 'set variable a to this message';
var_dump($b);
?>

gives you a better clue?


On 23 June 2013 23:06, Ethan Rosenberg, PhD <erosenberg@xxxxxxxxxxxxxxxxxxxx
> wrote:

>
>
>
>
> On 23 June 2013 21:37, Ethan Rosenberg, PhD <erosenberg@hygeiabiomedical.*
> *com <erosenberg@xxxxxxxxxxxxxxxxxxxx>> wrote:
>
>     On 6/23/2013 2:31 PM, Ethan Rosenberg, PhD wrote:
>
>         Dear List -
>
>         There is an error in my query, and I cannot find it.
>
>         This fails:
>
>         $_SESSION['Cust_Num'] = $_REQUEST['cnum'];
>         $_SESSION['CustNum'] = $_REQUEST['cnum'];
>
>         echo "session<br />"; //this has the proper values
>         print_r($_SESSION);
>
>         $sql10 = "select Balance, Payments, Charges, Date from Charges
> where
>         Cust_Num = $_SESSION[Cust_Num] order by Date";
>         echo $sql10; //echos the correct query
>         $result10 = mysqli_query($cxn, $sql10);
>         var_dump($result1); // this returns NULL
>
>
>     Against my better judgement, here I go again.
>
>     Is this the "actual" code you executed, or is it once again a typeover?
>
>     Your 1st error is in these two lines:
>
>         $result10 = mysqli_query($cxn, $sql10);
>
>         var_dump($result1); // this returns NULL
>
>
>     Yes your dump returns null.  And always will.
>
>
>     Any further errors might be related to your non-standard syntax for
> the session variable.  Per the manual, associative arrays using string
> indices should always use ' ' around them.  They work (as mentioned in the
> manual) but are wrong.
>     =======
>     Jim -
>
>
>
>     Is this the "actual" code you executed, or is it once again a typeover?
>
>             The actual code
>
>
>     Any further errors might be related to your non-standard syntax for
> the session variable.  Per the manual, associative arrays using string
> indices should always use ' ' around them.  They work (as mentioned in the
> manual) but are wrong.
>
>             Newbie is confused.
>
>             Please explain.
>
>
> Try ...
>
>  $sql10 = "select Balance, Payments, Charges, Date from Charges where
> Cust_Num = {$_SESSION['Cust_Num']} order by Date";
>
>
> --
> Richard Quadling
> Twitter : @RQuadling
> EE : http://e-e.com/M_248814.html
> Zend : http://bit.ly/9O8vFY
> =========
> Tried it. No luck
>
> Ethan
>



-- 
Richard Quadling
Twitter : @RQuadling
EE : http://e-e.com/M_248814.html
Zend : http://bit.ly/9O8vFY

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux