shepmom2002 Posted October 19, 2010 Share Posted October 19, 2010 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!! Quote Link to comment https://forums.phpfreaks.com/topic/216282-parse-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 19, 2010 Share Posted October 19, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/216282-parse-error/#findComment-1124004 Share on other sites More sharing options...
shepmom2002 Posted October 19, 2010 Author Share Posted October 19, 2010 Thanks!!! Quote Link to comment https://forums.phpfreaks.com/topic/216282-parse-error/#findComment-1124078 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.