Page 1 of 1
Re: phone number not storing in database
Posted: Thu Jan 21, 2016 10:48 am
by Celauran
First thing I see is you're closing PHP tags far too early.
Re: phone number not storing in database
Posted: Thu Jan 21, 2016 11:20 am
by Celauran
I don't see any inserts in there, only selects. This code doesn't save anything to the DB.
Re: phone number not storing in database
Posted: Thu Jan 21, 2016 11:59 am
by Celauran
$_POST['customer_phone'] is an array. You're using a loop to send the messages, but not to record them to the DB.
Re: phone number not storing in database
Posted: Thu Jan 21, 2016 12:07 pm
by Celauran
Yes. You have an array of values and you want an entry for each, right?
Re: phone number not storing in database
Posted: Thu Jan 21, 2016 12:08 pm
by Celauran
There are also repeated chunks of code in your form. These could easily be abstracted away to a function.
Re: phone number not storing in database
Posted: Thu Jan 21, 2016 12:28 pm
by Celauran
I'm looking at this specifically.
Code: Select all
$sqlCommand = "SELECT id, customer_name, customer_phone FROM repairs WHERE customer_phone LIKE '%44%' AND customer_name BETWEEN 'a' AND 'e' GROUP BY customer_name";
If you ever wanted to change that, you'd need to change is in a number of places.