Removing data from MYSQL that is comma delimited via Get and php -


What I'm doing is adding values ​​to each MySql table with each value separated by a comma and each new value The last value is added, which separates once again from the comma. Now all this is dynamic. How do I remove a selected value and a comma when I have a problem? I am using php and mysql I can read values ​​with explosion and line [value].

The name of the table is

ID, value, value_array in the table $ value_selected should be $ _GET ['value'] value_array is a column All values ​​separated by commas include.

The database selects those values ​​where the id is equal to the received value. Then value_array returns all the values ​​

Then I explode the values ​​and each value is read from the value_array through the looping and line [value].

  Code: Php $ value_selected = $ _GET ['Price'] Start; $ Query = mysql_query ("SELECT * FROM values ​​WHERE id = '$ value_selected'"); While ($ result = mysql_fetch_assoc ($ query)) {$ check_values ​​= $ result ['value_array']; } $ Value = explosion (",", $ check_values); $ Count_values ​​= Count ($ value); ($ Counter = 0; $ counter 
$ count_values; $ counter ++) {$ line = each ($ value); $ Query = mysql_query ("SELECT * FROM values ​​WHERE id = '$ line [value]' '); while ($ result = mysql_fetch_assoc ($ query)) {resonance $ result [' value '].' & Lt; I have no problem reading this. What am I trying to do, in choosing a value through GET? Is enabled and removing that value from value_array as well as removing the previous comma, I hope I was able to extend my problem further.



Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -