Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2016
    Posts
    55
    Thanks
    20
    Thanked 0 Times in 0 Posts

    Why my query is showing all users amount insted of current user? any prob with sql?

    Hi,
    Thank you for your time spending to help me.

    I am trying to display only the list of amounts in case of current id but it is showing all when I have used WHERE clause to set. Can you help me indicating if any mistake I have done in my Query?

    Code:
    $sql_inccur = "SELECT * FROM incomes LEFT JOIN inctype ON incomes.inctype_id = inctype.inctype_id LEFT JOIN customer ON incomes.cust_id WHERE incomes.cust_id = '$_SESSION[cust_id]' ORDER BY inc_date DESC";
    	$query_inccur = mysqli_query($db_link, $sql_inccur);
    	checkSQL($db_link, $query_inccur);

  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    8,082
    Thanks
    37
    Thanked 1,081 Times in 1,077 Posts
    I think this one has been answered in this post https://www.codingforums.com/mysql/3...-3-tables.html
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •