Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:07:34+00:00 2026-06-08T13:07:34+00:00

I am trying to build a customer e-commerce backend. I’ve done stuff like this

  • 0

I am trying to build a customer e-commerce backend. I’ve done stuff like this many times before and don’t consider myself “new” to php & mysql, but I am stuck and can’t figure out what is wrong.

I just want to display the content of a mysql row at a specific location (using the “WHERE” command).

But when I load the page, the content part (in the tables) comes up empty. There is definitely content within the table at that location and everything else on the page displays EXCEPT for the actual customerResults.

Here is my code:

<head>
<title>Customer Summary</title>
<?php  
    session_start();
    require 'database_connect.php';
    $customerTable = "customer";

    if(isset($_GET['customer_click'])){
        $customerId = $_GET['customer_click']; 
    }
?>
</head>
<h3>Customer <?php echo"$customerId"?></h3>
<table align="center" width="600px">
    <tr>
        <td><a href="index.php">Summary</a></td>
        <td><a href="personal.php">Personal</a></td>
        <td><a href="billing.php">Billing</a></td>
        <td><a href="order_history.php">Order History</a></td>
    </tr>
</table>
<table align="center" width="400px">
    <tr>
        <?php 
            $customerSelect = "SELECT * FROM $customerTable WHERE id = '$customerId' ";
            $customerResult = mysql_query($customerSelect);
            if (!$customerResult){
                echo "No results, but why?!?!? </br/>";

            }
            if  (mysql_num_rows($customerResult)==0){
                echo "Results are empty...but why!?!?!";

            }

            while ($customerData = mysql_fetch_assoc($customerResult)){ 
                echo $customerData['id'];
                echo $customerData['email'];
            }

        ?>      
    </tr>
</table>

I could be over-looking something simple, but I really can’t figure this out

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:07:35+00:00Added an answer on June 8, 2026 at 1:07 pm

    Let’s see:

    • Line 27: Undefined variable 'customerSelct'.
    • Line 41: Undefined variable 'customerDdata'.
    • Line 43: Undefined variable 'result'.

    Plus Please, don’t use mysql_* functions in new code. They are no longer maintained and the deprecation process has begun on it. See the red box? Learn about prepared statements instead, and use PDO or MySQLi – this article will help you decide which. If you choose PDO, here is a good tutorial.

    Example code using PDO:

    <?php
        try {
            session_start();
            if (!isset($_GET['customer_click'])) {
                throw new Exception('Customer ID not provided.');
            }
            //Assuming the ID must be a number.
            if (!is_numeric($_GET['customer_click'])) {
                throw new Exception('Customer ID must be numeric.');
            }
            $customerID = $_GET['customer_click'];
            $db         = new PDO("mysql:host=localhost;dbname=database_name_here", "user", "pass");
            //Have PDO to not emulate prepared statements by default.
            //Instead use MySQL's native prepare engine.
            $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
            //PDO will throw PDOExceptions on every error.
            $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            $query = "SELECT * FROM `customer` WHERE `id` = :id";
            $stmt  = $db->prepare($query);
            //Bind ID as a number and not as string.
            $stmt->bindValue(":id", $customerID, PDO::PARAM_INT);
            $stmt->execute();
            //Fetch all results into $result.
            $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
        }
        catch (PDOException $e) {
            //A database error has occurred!
            die("Database Error occurred! " . $e->getMessage());
        }
    
        catch (Exception $e) {
            //General error occurred!
            die("Error! " . $e->getMessage());
        }
    ?>
    <!DOCTYPE HTML>
    <html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
    
        <pre>
            <?php print_r($result); ?>
        </pre>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to build openssl-fips-2.0 with NDK, before I was lucky found this link and
I'm trying to build a facebook like search for my software. I'd like to
My company is looking at various PHP frameworks to build a customer's site. This
I'm trying to build a New Customer form, so I'm using the default model
I'm trying to build a query that returns a collection that contains a customer's
I am trying build a jQuery EasyUI datagrid or treegrid out of a large
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm trying build a method which returns the shortest path from one node to
I'm trying build an App Engine connected Android application and am having some problems
I'm trying build a MVC framework, but I'm confused about manage themes. Well... I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.