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..

No comments posted yet

Your Answer:

Login to answer
253 Like 8 Dislike
Previous forums Next forums
Other forums

PHP arrays into arrays need help
Hello
I am trying to highlight the days on my calendar based on the dates that i have in my datab

Create or replace package is ending ORA-21700
Database 9.2.0., patch 8 (9.2.0.8.0).
I trying run
create or replace package ....etc.

Accept only alpha characters
I've got this bit of code ready for accepting a phrase:

Code: if (!eregi ("", $_POS

Login Script Issues
I am using a script I got from http://phpsense.com/php/php-login-script.html in order to allow peopl

PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

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