Jump to content

Recommended Posts

I have some php code on view invoice and it's getting all the data I need to from three database tables but for some reason it's not getting the data for one specific column and unsure why

I have done a echo sql and it is echoing the sql query ok and have ran the sql query in phpmyadmin and is displaying the column in phpmyadmin that is not displaying on the php page so am bit confused, below is the coding I have. I took out a lot of it and tried to keep to the relevant parts

<?php
$sql = "SELECT t1.id, t1.invoice_number, DATE_FORMAT(t1.invoice_date,'%d/%m/%Y') AS invoice_date, t1.user_id, t2.invoice_number, t2.service_name, t2.service_price, t3.user_id, t3.customer_name, t3.customer_phone, t3.customer_email, t2.service_name, t2.service_price, t1.invoice_total, t1.balance, t1.notes, DATE_FORMAT(t1.payment_date,'%d/%m/%Y') AS payment_date, t1.payment_method
FROM invoices as t1
LEFT JOIN invoice_products as t2
ON t1.id = t2.invoice_id
LEFT JOIN users as t3
ON t1.user_id = t3.user_id
WHERE t1.user_id = '".$_SESSION['user_id']."' and t1.id = '".$_GET['id']."'";

$result = mysqli_query($connect, $sql);

                if(mysqli_num_rows($result) > 0)
                {
                if($row = mysqli_fetch_array($result))  
                {
                ?>

                Notes: <?php echo $row['notes'];?>

                <?php
                    }
                    }
                    ?>

 

Link to comment
https://forums.phpfreaks.com/topic/313381-unable-to-retrieve-data-for-one-column/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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