How to update this array?


Posted on 16th Feb 2014 07:03 pm by admin

I am saving a string that looks this: username1, username2, username3...
into a single cell in a database table.
I am doing this so that when I retrieve that string using normal methods, I can turn it into an array.

However, my question is: I will need to update that cell and add user names to it. and then save it back to the database.
I don't have any example code as I haven't started because I am not sure where to start.

This is what I was thinking.

It will start out with one username "username1".
That is what the original value will be. I then need to pull that info out (easy) and populate an array

Code: $original = 'username1';
$userArray = array($original);
I then need to turn around and add 'username2' to $userArray. and add it to the DB so it is formatted as username1, username2, username3..

253 Like 8 Dislike
Previous php-forum Next php-forum
Other php-forum

disable all input buttons
Hello Friends,

suppose i do have a file ( file.php ) has a submit button

Code: [Sele

GET * FROM _____ Except?
I have a site that is for stock photography.

This section of the code calls images to display

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Display a default image
I am trying to display generic image for items that don't have one, but I can't get it to display.

check if value exists
I have googled this for a while and I am getting lots of different results. Is there a standard meth

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to

asking for direction
I have 2 tables in my data, which are "post" and "event"
I won't make a summa

Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash