Hi did not have a problem connecting to db. I sent the question with root for password and username for secerity reason.
I need to have a string entered into a cell so that I can retrieve that cell as elements of array. Those elements will be used as values of a form.
Hence, if I like to have echo $a[0] print out "hello" and $a[1] print out "in this world" I need to have "hello" and "in this world" in one single cell of the database.
script wrtten
<?php
$connection = mysql_connect("localhost", "root", "root") or
die ("Unable
to connect!");
mysql_select_db("test") or die ("Unable to select
database!");
//$result = mysql_query('select page_values from test
// WHERE valueid = 2') or die (mysql_error());
//echo $result;
$query = "SELECT page_values FROM test";
$result = mysql_query($query) or die("Error in
query: " .
mysql_error());
$a = mysql_result($result,0);
echo $a[0];
//echo $result;
?>
+---------+-------------------------------------------+
| valueid | page_values |
+---------+-------------------------------------------+
| 1 | array('Good Day','Please Come Again'); |
I can easily print =array ('Good Day','Please Come Again');
but when I try echo $a[0]; I get the letter a
I am expecting to see Good Day
My goal is to store a array in a cell in my db and retrive the array
later .
Thanks Tom