I’m trying to pull out information from a database with PHP and have the following query:
$q = "SELECT CONCAT_WS(' ',FirstName,MiddleName,LastName) AS Name,
(NewCustomerID) AS customerid,
substring('Firstname',1,1, 'MiddleName'),
left(MiddleName,1) AS MN,
(LastName) AS LN
FROM customer
Where FN.MN.LN = 'username'";
$r = mysqli_query ($dbc, $q);
$num = mysqli_num_rows($r);
when I run this, I get info back but not the username, which I need:
$q = "SELECT CONCAT_WS(' ',FirstName,MiddleName,LastName) AS Name,
(NewCustomerID) AS customerid,
left('Firstname',1) as FN,
left(MiddleName,1) AS MN,
(LastName) AS LN
FROM customer".
Just stuck, have tried quite a few things and just can’t get it to work.
1 Answer