Jump to content

Parse Error


shepmom2002

Recommended Posts

I am very new to php.  I am getting a parse error, and I have tried several things, but can't figure out what the problem is.  Here is my code:

 

<?php
// This script retrieves all the records from the customers table.

echo '<h1>Customers:</h1>';

require_once ('mysqli_connect.php'); 	// Connect to the db.



$q = "SELECT Customers.CustomerID as customerid, Customers.OldCustomerID AS oldcustomerid, Concat_WS( Customers.LastName, ',', Customers.FirstName, ' ', Customers.MiddleName ) AS Customer_Name, Concat_ws( Left( Customers.FirstName, 1 ) , Left( Customers.MiddleName, 1 ) , Customers.LastName ) AS Username, zlu_Cars.Description AS Car, zlu_CarColor.Description AS Car_Color, zlu_Computers.Description AS Computer,  CASE when (Customers.IsLaptop=1) then 'Yes' when (Customers.IsLaptop=0) then 'No' end AS Laptop, zlu_Race.Description AS Race, zlu_Residence.Description AS Residence, zlu_BirthMonth.Description AS Birth_Month 
FROM (((((Customers INNER JOIN zlu_BirthMonth ON Customers.BirthMonthID = zlu_BirthMonth.BirthMonthID) INNER JOIN zlu_CarColor ON Customers.CarColorID = zlu_CarColor.CarColorID) INNER JOIN zlu_Cars ON Customers.CarID = zlu_Cars.CarID) INNER JOIN zlu_Computers ON Customers.ComputerID = zlu_Computers.ComputerID) INNER JOIN zlu_Race ON Customers.RaceID = zlu_Race.RaceID) INNER JOIN zlu_Residence ON Customers.ResidenceID = zlu_Residence.ResidenceID ORDER BY Customers.LastName, Customers.FirstName
LIMIT 499,101"


$r = @mysqli_query ($dbc, $q);// Run the query.

// Count the number of returned rows:
$num = mysqli_num_rows($r);

 

I'm obviously not showing you all my code, the error is this line:

$r = @mysqli_query ($dbc, $q);

 

Error says:  Parse error: parse error in D:\WebShare\PHP\ShepherdS\view_Customers.php on line 17

 

Any idea what I am doing wrong???  I'm completely lost!!

Link to comment
Share on other sites

The problem is a missing semi-colon ; on the line above where the error is being reported.

 

When you leave out some php syntax, the language parser does not know what you intended (the following line could have been a continuation of the line that is missing the closing ;) and can only report when it does find something that does not belong in the current context.

 

Also, don't put @'s in your code (ever.) All they do is hide errors. Your code still won't work AND you won't get any errors to help you find where the problem is at in your code.

Link to comment
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.