Replace your sql select query with these lines:
SELECT LASTNAME, FIRSTNAME, DEPARTMENT
FROM EMPLOYEES WHERE LASTNAME LIKE '%varLastName%'
It makes caseinsensitive search, so when varLastName is 'C'
it will find Clark and Wilcox ,because they contain letter 'C'.
Also you can use 'varLastName%'
I have a column of amounts that was getting adding in a loop but I see
there's a sum() function to do this. Should have known. But I can't
make it work. Can someone give me a simple query syntax using php?
$table=my_table;
$field=some_field;
$sql=SELECT sum(cost) AS cost FROM '$table'
I am trying to add floating point numbers, and also plain
numerical values,
- I have looked on mysql.com but I only seem to find stuff that
relate to
counting rows of a certain defined value - like count where something =
something, but I want to say give me a numerical total value
for a
CA $ select * from table_name where column_name like %my_string%.
select * from table_name where column_name NOT like %my_string%.
;)))
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)