Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Mysql_fetch_array Way To Pull Out All The Data, Store It In An Array


I have a webpage which runs repetitive queries agaist a database in order to extract one item at a time and then put the items in an HTML table. The reason for this is formatting, plus the page hits 4 databases.

Instead of running multiple queries pulling one item at a time...is there a way to pull out all the data, store it in an array, and then pull individual items from the array with php as I want to insert them in the table? So, example is Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Using The Mysql_fetch_array Function To Pull Data In As An Array.
Im currently pulling in a load of data from my sql table. I found that using the mysql_fetch_array function was the way to pull it all in as an array.

The only problem? I cant manage to get it to store a value into another name eg $ip = $row['ip'] and count how many instance's are contained within it. I need to do similar things to the 'url' and the 'time' but as I cant access the data there isnt much I can do!

View Replies !
Mysql_Fetch_array(); Pull An Array Of Data From Mysql
im trying to pull an array of data from mysql. this is the code im using. PHP Code:

//the sql syntax below pulls the last 7 records from the database

$sql     =    "SELECT * FROM db_news ORDER BY 'id' DESC LIMIT 7";

$query    =    mysql_query($sql) or die('MYSQL QUERY ERROR' . mysql_error());

while($row = mysql_fetch_array($query))
{
echo $row['id'];
}

the code above outputs 'id's' 7 to 1 as 7654321. what i want to do is explode the 7654321 into an array so i can call them any where on the page. and not just while the while loop is running, complicated ? what im trying to do is grab the latest 7 news reports from mysql and then display them in certain places on a webpage.

View Replies !
Pull Data From Mysql Db And Break This Into An Array
I am trying to pull data from mysql db and break this into an array that I can then pull certain bits of data from, hope this makes sence to someone. PHP Code:

$dbh=mysql_connect("localhost", "$username", "$code") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("$database");
$query = mysql_query("SELECT * FROM `allflights` WHERE id='$callsign' ORDER BY date DESC LIMIT 5") or die (mysql_error());

I would like to place like data for say these five items so I can have them stored in arrays and then select the different data as needed from each one.

View Replies !
Get Data From The Db And Store It In An Array
I want to have an input field in my Admin CP when you are creating a Forum where you can input a list of numbers (member ids) seperated by commars, like this:

Quote1,6,4,8,2
These will be the ids of people who can moderate the Forum and will be stored in the db along with all the other stuff like forum name/description etc.

That's easy enough.

Now my problem is I need to get that from the db and store it in an array... basically so I can do something like:

<?php
if(in_array($_SESSION['mem_id'], $forum_moderator_array)) {
    echo('Congratulations, you are a forum moderator.');
}
?>

How can I go about doing this?

View Replies !
Store While Statment Data In Array Using Session And Retrieve?
I wish to store retreve value from my sql using session array and retrieve this value.
here is my while statement, which is displaying records from my database. I want to store all this value in an array using session and than retrieve this value on click of the table row. Code:

View Replies !
Pull Data From Mysql From A Varchar Field With Comma Seperated Data
I'm trying to pull data from mysql from a varchar field with comma seperated data, like: test, test, test, and so on. when I try to display the data i just get "array" in the input field. what i'm wondering is how can I show the data correctly? I'm a little lost here.

View Replies !
Pull The Data Directly From A Data Feed
I am currently building a site that would be easier if i could pull the data directly from a data feed. ButI'm new to PHP and I don't know how to create a bit of script to do this.

View Replies !
Use Sessions To Store Data And Use That Session To Get Query Data.
We have some Java programmers in our software dev, and they are
pressuring us to use Sessions to store data and use that Session to get
query data. They say that it is ok since it is like Entities in Java. I
am baffled as a .NET programmer, we tend to avoid using sessions and
instead use DataSet, is there any equivalent of dataset in PHP?

View Replies !
Pull Data Out Off Mysql
I am making a database using mysql where i have 2 tables, one for car manufacturers and one for car models.I've already done that. I have made a php page where i have 2 drop down menus.

The first menu shows car makers(manufacturers) and the 2nd nothing. Now when a user opens the 1st menu and selects a maker , the 2nd automatically fills up with models from that car maker only and it gets its information from the database.That is every time i decide to add a new model to my database the 2nd menu (if selected) must go and search the database for all the models for that maker and show them. Code:

View Replies !
How Do You Pull All Data From A Field?
How do you pull all data froma field no matter what its result.. like this..

results.php?city=$city&type=ALL&zone=$zone

so where type=all i want to get all restaurants in whatever $city in whatever $zone, meaning chinese, mexican, all rest listed in persay newyork zone 1 what is the wildcard to pull that..

View Replies !
Mysql_fetch_array - URL Is Array
<?php

//start session
session_start();

//store cmpid from querystring
$_SESSION['session_cmpid'] = $_GET['cmpid'];
$campaign=$_SESSION['session_cmpid'];

//connect to db server
require dirname(__FILE__).'/core/dbconnect_vps.php'

//select db
$database = "atdata";

//define sql
$sql_campaignredirect = "SELECT web_confirmurl
FROM tbl_marketingcampaign
WHERE marketingcampaignid = '$campaign'";

//run sql
$result = mysql_db_query($database,$sql_campaignredirect)
or die (mysql_error());

//fetch data
$campaign_url = mysql_fetch_array($result);

//display data
echo 'URL is '.$campaign_url;

?>

Instead of displaying the data (http://www.domain.com), it returns:

URL is Array

I know it's probably a simple oversigt on my part but can't seem to
figure it out.

View Replies !
Pull 1 Number From An Array
I'm trying to set an array of a series of 6 single or double digit part numbers and match it against a user input selection of part numbers.  For example, if the user is looking for part numbers 10,9,43,7,6 from an item that has part numbers 10,14,16,31,43,50 then it would highlight that part numbers 10 and 43 are a match, but so far it's only highlighting 1. Code:

View Replies !
My Host Has NO PHP, Pull This Data From Another Server
I'm wondering if anyone here can point me in the right direction. My host
does not provide php, and so I need to pull this data from another server
that does support such scripting.

View Replies !
CURL To Pull Data From A Site
I've been using php and cURL to pull data from a site, and things worked just fine. however, when i used the same script to access a different site, not data is being returned. however, i can go to the url of the site being used and there is clearly html there which should theoretically be scraped. any idea why it is not being gathered and how can i fix this?

View Replies !
Pull Data From A Second Sql Query Using A Where Clause
I am trying to pull data from a second sql query using a where clause = two fields from the first query. I am trying to gather from the second query, any data where we have a match from either of the two in the where clause.

sql=my select 1,2 from t1

while $row {

$one=$row[1];
$two=$row[2];


sql=select 1,2 from t2 WHERE 1 = '$one' or 2 = '$two' group by 1,2

while $row2 {

//trying to output all rows that either 1 or 2 from t2 match 1 or 2 from t1. so all grouped results from 1 display all unique results in 2all grouped results from 2 dispaly all unique results in 1 where either 1 from t1 = 1 from t2 or 2 from t1= 2 from t2.

View Replies !
Retrive Data From Pull Down Menus
Here is the code that I got to pull two separte lists from a SQL DataBase. Code:

View Replies !
Resource Id #3 - Pull Out Data From My Table
I am trying to pull out data from my table. I know there are some records there, but when I tried the following code:

$query = "SELECT * FROM logpage WHERE user = '$user_name'";
$result = mysql_query($query);
echo "result is ", $result, "<br>";
I got "result is Resource id #3".

View Replies !
Script To Pull Data From SQL Table
I'm running a php-enabled dedicated server. All my sites on said server incorporate simple php scripts (includes, month/date, etc.) and that's the extent of my php knowledge.

Some of my sites have SQL databases which I administer via phpmyadmin, but I've been unable to track down a simple php script to:

* open the database
* refer to a specific table
* extract data from the table
* display the data on a website

Can anyone point me to an online doc or provide a simple script to follow which I can customize for my purposes?

View Replies !
Pull Data From MySQL Database
I'm running a PHP script called phpOnDirectory on thsi website i'm creating so that people can have their companies listed in our directory. Currently, the script displayes the directory in a left-hand column, and the results in the center column.

When you access a category, the script displays the number of listings withing that category in parenthesis next to the title. What my client wants is to take that out(easy enough) and have the totals listed next to the categories on the left. Code:

View Replies !
Pull Data From A Table Using A While Loop
I noticed that when I pull data from a table using a while loop I am always missing the first entry in the set. To solve it for now I have placed a Dummy entry into the database, which works fine for simple lists but when the query begins to ask for any number of combinations of fields it seems like that is not a suitable fix.

View Replies !
Array Returned From Mysql_fetch_array...
I am trying to figure out how to access the array returned from this function using the incremental approach ($i)... however $array[column][$i] doesn't seem to work... it just returns the first letter of that column's entry.

I can't use the standard while($row = mysql_fetch_array($result)) for what I am doing: say that loop runs 6 times. I am filling a table with 10 cells always - pulling the remaining cells from a completely different query. Right now, my table is being constructed with only 6 cells SO I want to have a FOR loop, and then use that $i to get what I need from both queries.

Anyway, all I am looking for is a description of the array returned, and how to access each column, and each row using increments.

View Replies !
Setting Array Key To 1 Instead Of 0 With Mysql_fetch_array
i have a mysql statement that is selecting many records from a DB and then im using them in an array later and in a for loop where $x changes thus changing the array data but i want the array to start form key 1 instead of key 0

i know theirs an easy way to do it as with other languages but im pretty new to arrays and ive not been able to find it on php.net

here and example of how my code works: Code:

View Replies !
Pull All Words From 'title' And Put It In An Array
How am I able to put all the words I pulled out from a query and turn it into an array like the example below? Code:

View Replies !
Session Data Not Being Saved With Mysql_fetch_array
Subject pretty much sums it up. If I do the following, everything works great

if ($user_info = mysql_fetch_assoc($login_result)) {
foreach($user_info as $key => $val) {
$$key = stripslashes($val);
$_SESSION[$key] = $val;
}
}


however, if instead I use
if ($user_info = mysql_fetch_array($login_result)) {rest is the same}

it saves nothing to the session file and crashes when I call a session var "index does not exist". Sure enough if I print_r($_SESSION), I get nothing but an empty array.

I thought it might be because $$key doesn't give a proper name for the index when it is the numeric index, but when I do a print_r($_SESSION) before going to the next page, everything looks as it should
Array ( [0] => Baggins [last_name] => Baggins [1] => Bilbo [first_name] => Bilbo)

View Replies !
Using A Loop To Pull Data From Mysql Recordset
This has set me back a couple of days now and I could really use some
help or at least a shove in the right direction.

What I'm trying to do is list reviews in a database on a page, by
artist (byartist.php). The first step is pulling each artist and
listing them alphabetically. If the artist has more than one album
reviewed, they should still only show up once, so I need to check each
row of the recordset, and check the artistname against a variable or
something, and if it exists, to just skip it and move on to the next row.
Then I need to list the albums reviewed under each respective artists
name and use them as links with url parameters to the respective review
pages.

I've got the recordset down per some advice from another newsgroup, and
I'm fairly certain its correct for what I need to do.
<?php require_once('conntest.php'); ?>
<?php
mysql_select_db($database_test, $test);
$query_byartist = "select artists.artistid, artists.artistname,
areviews.albumid, areviews.atitle from artists join areviews on
artists.artistid = areviews.artistid";
$byartist = mysql_query($query_byartist, $test) or die(mysql_error());
$row_byartist = mysql_fetch_assoc($byartist);
$totalRows_byartist = mysql_num_rows($byartist);
?>

The php example I was given for pulling the results was kind of
half-effort and not enough for me to really see what was going on,
understand it and build upon it. I'm (obviously) just starting out with
php/mysql and I'm pretty good at building upon something in front of me
and figuring it out, just need a little help because I've tried it over
and over and to no avail, I wind up with syntax errors.
Sorry for the wordy post, I didnt want to skimp. Thanks for any help or
advice or any points in the right direction. I've got about 3 days of
progress to catch up on

View Replies !
How To Pull 1 Line Of Data From A File? NO MYSQL
I have this file that has 2 lines in it. Heres how the files looks.

file: fbddata.lbn

line1:uncle1234562
line2:

As you can see, on line 2 there is actually no data but the file still seems to have a 2 lines. But when I pull the info from the file using the "include" or "require" command it just pulls the 1st line of data. BUT..when I try to use the "include" or "require" php commend within a HTML link code like this....

<a herf="www.mysite.com/Lavishphpfreak/<?php include("fbddata.lbn" ?>/ilovephp.php>LINK[/url]

it gives me a link that this...

http://www.mysite.com/Lavishphpfreak/uncle1234562
/ilovephp.php

now did you notice the code that was added to the link. I have figured out that its doing this because of the blank line 2 thats in the fbddata.lbn im trying to pull the data from. Of course the easy way to fix this would be to just go into the file and delete the blank like 2 but i can't do this because i dont have permission to edit the file. Its created using "root".

So does anyone know of a php code that will just pull the 1st line of data from within a file. I can't use mysql cause this is NOT in a database..and plus I haven't advanced to databases yet.

View Replies !
Pull Data From Database And Show It In Forms
I have created an online survey form for my boss about one of his course. He needs his students to do the evaluation for a topic when he finishes each topic. For example, when he finished topic 1, he told students to evaluate topic 1.

Two weeks later, when he finished topic 2, he asked the students to evaluate topic 2, so on. I created the survey form with radio buttons and I would like each student can keep his own record for the previous topic. For example, when it is time to do the evaluation for topic 2, when he opens the survey form, he can see his reply for topic 1. Code:

View Replies !
Main Page Database Seems To Not Pull Any Data At All.
I have a page that has a connection to a database. I also call a function that makes a connection to a new database, outputs some data and closes. The problem: When I call the function, the main page database seems to not pull any data at all. Im using all new database connection variables and closing them. Still the main connection stops working.

View Replies !
Is There A Way To Pull Out Book Review Data From Amazon?
I know their I can use the rss feed for their books with their API, but is there a way to pull out book review data from Amazon???

View Replies !
Pagination Query - Pull The Data From The Database
I'm trying to paginate some query results but when I click on "next" to go to the next set of results, the query fails. Here's what I'm using to pull the data from the database. PHP Code:

$sql="SELECT id, student_id, first_name, last_name, address, city, state, zip, DOB, gender, grade, aka FROM student WHERE last_name LIKE '".$_GET['last']."%' and current_student='yes' ORDER BY last_name LIMIT $offset, $rowsPerPage";
    $conn = db_security_connect();
    $result = mysql_query($sql,$conn);
    $query   = "SELECT COUNT(*) AS numrows FROM student WHERE last_name LIKE '".$_GET['last']."%' and current_student='yes'";

View Replies !
Array Question - Mysql_fetch_array Problem
I'm retrieving information from a database -- the retrival is in a function which returns the results. (my particular example only returns 2 items now spanning 5 columns )

I've tried a foreach, while, for, etc... to display both products, however, the web page will show two columns of product number 1, each spanning 10 rows.
for example, if my code is similar to this:

foreach ($products_similar as $similar) {

HTML CODE
$similar['products_id']
$similar['products_name']
$similar['products_model']
$similar['products_image']
$similar['products_price']
}

I would receive the following listed 10 times (rows) in 2 columns:

[image]
Product 1
model number 20109
$100.00
View Item

I'm using mysql_fetch_array -- I've heard there is something odd with foreach and fetch_array -- something of an associate array being created.

Could anyone provide infomration on this and perhaps a solutions?

View Replies !
Need Advice On Making An Array From Mysql_fetch_array.
First I do understand that mysql_fetch_array is an array by its self, but my problem is, that this array will be padded with alot of items that I really don't want, such as nulls, id field and list name.

You see my idea is to have a table that stores select list items.
This can be used to allow users/admins to modify my scripts to add in what data they need to suite their needs...

This would replace my static arrays that I have created for various things. Now I had two arrays, one for a long name and one for a short name. Their keys matched up. Now when trying to move these items into a database, I have two rows, again one for long and one for short.

For space reasons, when I create items in my database I create a simple string from the keys, then I explode this and pull the various information out.

View Replies !
Mysql_fetch_array - Convert The Results To An Array
I've got following code:

         $sql = "select user_id from sales_users where sales_id = ".$user['id'];
         $res = mysql_query($sql);

         echo mysql_num_rows($res);

         $clients = mysql_fetch_array($res);

It's a database containing users(sales_id) tied to clients(users_id). Each is is salesman for one or more clients, so obviously the resulting array has one or more rows. Whensales_id is 44, there are 3 rows: user_id's 4,13 and 45.

The echo of mysql_num_rows tells me there are indeed 3 rows. Now here it comes: when I convert the results to an array, I only get 1 element in the array, user_id 4. When I change the user_id's, it always returns the lowest user_id and leaves the other 2 behind. A print of the resulting array:Array(=> 4)

What am I overlooking? Up until now this has always worked well for me, but now I really don't see what could be wrong.

View Replies !
Mysql_fetch_array -- Array Values Not Reusable?
I have the following code:

<select name="category" id="category" class="input_text">
<option value="">Select a category</option>
<?php
while ($rows_cats = mysql_fetch_array($result_cats)):
$catID = $rows_cats['catID'];
$catName = $rows_cats['catName'];
?>
<option value="<?php echo $catID; ?>"><? echo $catName; ?></option>
<?php endwhile; ?>
</select>

Now, that goes into a drop down menu that shows the categories. However, I have several drop down menus (a person can select three categories). However, when I try to do another while with the same code, it doesn't fetch the results. Code:

View Replies !
Strpos To Find Xml Tags To Pull Out The Text Data
I'm trying to use strpos to find these xml tags so I can pull out the text data; but the bracket chars won't let the function work. Is there another way to do this?

$php_XML_tag = "<codeFacility>ZNY</codeFacility>";
$pos = strpos($php_XML_tag, '<codeFacility>');
print $pos;

results is $pos == 0

View Replies !
Pull Data From MySQL Database And Display On Web Page.
I am trying to pull specific data from MySQL database using PHP and have it displayed on my web page. Go to my web page to see exactly what I want to do.

Right click on the link and open it in a new browser or else you will get stuck in the page. Please come back and post a reply with your knowledge. Code:

View Replies !
Array Question - Pull Information From On A Bunch Of Pages.
I'm just starting in php, although I have a little programming experience in
other languages, but only on a surface level.

I have a multidimensional array that I want to pull information from on a
bunch of pages.

$county = array (
array (
key=>"adams",
name=>"Adams",
govwebsite=>"http://www.co.adams.wa.us/default.asp"
demwebsite=>"" ),
array ( name=>"Asotin",

I'm trying to write the php script for the pages to identify the sub array
by the filename, pull the rest of the information out of the array into
variables, and then use those variables to write the page. I've searched
and tried a bunch of things, and nothing is working. Here is what I have:

<?php
include("countiesarray.inc");
$path = __FILE__;
$filename = basename ($path,".php");
foreach ($county as $key => $ArrayRow)
{
if ($ArrayRow[0] == $filename)
{$countyname = $ArrayRow[name];
$govwebsite = $ArrayRow[govwebsite];
$demwebsite = $ArrayRow[demwebsite];
};
);
include ("header.html");
include ("title.html");
if ( $govwebsite != "" ) { include ("countyweb.html"); };
if ( $demwebsite != "" ) { include ("countydemweb.html"); };
include("../navigation.html");
include("../copyright.html");
?>

The error I get is Parse error:
parse error in /home/calador/public_html/wapolitics/counties/adams.php on line 12.
Line 12 is the end of the foreach loop.

View Replies !
Pull Info From An Array, And Declare That As A Session Varible
I need to be able to pull info from an array, and declare that as a session varible. I have no idea how to interact with arrays Code:

View Replies !
Pull Data From The Database And Generate A Normal Text File
I have a database that is correctly storing characters like the trademark symbol, copyright,ect. I then pull data from the database and generate a normal text file from it. I do not do anything other then echoing out the direct database info into a variable and then building the file from the variable.

When I open the text file, ALL my trademarks, copyright, apostrophies, anything other then alphanumeric becomes question marks. "?" I have no idea how to fix this. Can anyone lead me in the right direction on what needs to be done to fix this. The database charset is 8859-1 I beleive, and my html pages are also 8859-1 and also render the data wrong, same "?"

View Replies !
An Extra Last Empty Field In An 'mysql_fetch_array' Result Array?
I seem to get an extra empty field in every 'mysql_fetch_array' command I issue. For example:

I have a simple table 'tblName':

ID Name
1 Jane
2 Joe
2 Doe

The following code:

$oCursor = mysql_query("SELECT ID from tblName WHERE Name='Jane'");
if (!$oCursor)
{
$bGo = false;
}
else
{
$aRow = mysql_fetch_array($oCursor);
}

results in:

count($aRow) = 2;

$aRow[0] = 1;
$aRow[1] = ''

Am I missing something, doing something wrong, a wrong PHP setting?

View Replies !
Store Data
I need to store the data of a golf course and a round. so what I am wondering from all our database guys is what is the best way to normalise this data?I need to store the info on 4-5 sets of tees and then a users information.

my thoughts were to have a course table. then have a red,blue, black, white, gold tee table that is linked with the course id field however then I would have hole 1 - hole 18 fields in those databases is that really the only way? I mean I guess I could store the info in one field with commas and then explode the data after that, would that be too much of a performance issue?

View Replies !
Store Data In Session?
how to store id in a session?? i'm trying to develop a shopping cart, whereby user need not login when they add products into cart. if i add one product into the cart, then everything is fine. if there's one product in the cart and i click continue shopping and add one more product, the first product will not be there, it will be replaced by the second product. how am i suppose to solve tat?

View Replies !
Where Does The Session Data Store?
In php.ini file, if I comment the session.save_path line, then actually I can still use session, but where do it store? I am using Window filesystem.

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;session.save_path = /tmp

View Replies !
Want To Store Some Data In Sessions
I want to store some data in Sessions, but i have this error

Warning: Unknown(): Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session extension
does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively. in Unknown on line 0

Warning: Unknown(): open(/tmpsess_622d49ff6fbad164ba2ad7cd05fdd544, O_RDWR)
failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that
the current setting of session.save_path is correct (/tmp) in Unknown on
line 0

My version of php is version 4.3.4

Is there something that I have to change in my php.ini file?

View Replies !
How Much Data Can I Store In A Session?
Is there a limit to the amount of data that can be stored in a session before nasty side effects (such as a drop in performance or excessive resource usage on the server) will occur?

I'm working on a DHTML menu that's being rebuilt from MySQL table data on each page reload. Lots of loops and iterations, which slows down the page load, creates a nontrivial CPU load on the server, and is inelegant in general. I'm considering rebuilding the menu once and then caching it for, say, 5 minutes. I'm considering storing the entire menu code in the session, which currently comes to 32k of menu code but may (and probably will) be twice that much, or more, in the future.

So... is it stupid to dump 32-64k of HTML code into $_SESSION, or can I get away with it? What are the consequences? Code:

View Replies !
Good Way To Store Data For Each Day
I need a good way to store data for each day, but it needs to be accessed easily.

data 1 - 125478
data 2 - 123549

Those numbers would change each day, and i need to store that value for each day.  It would be kinda like a stats archive.

I would need to refer back as far as one year from the first date.

Is there an easy way to do this?

View Replies !
Using Session To Store Data
For instance, when a user clicks on a whosonline list maybe they like to to be displayed Z-A by default

Normally you would save this data in a database.. which I will

However, I dont want to have to query the database everytime I need to find out if they want something displayed to there Z-A preference

So, upon login I was thinking of querying the database and then storing everything I need in SESSIONS

Is this the norm or are there better ways to do this. If it is the norm, can you think of any reason why this would be a bad idea..

View Replies !
Store Values In An Array
$a=10;
$a=15;

while ($a <= $b)
{
$a++;
}

The output is 10,11,12,13,14,15

How to store the values of $a(10,11,12,13,14,15) in an sigle array.

View Replies !
Store Classes In An Array?
Is it possible to store classes in an array? I am fairly new to PHP,
and haven't found anything either way yet.
I have a program that where you can have multiple notes attached to a
ticket, which are stored in a database. I would like to just pull all
the notes from the database, storing each one in a seperate class,
which itself is stored in an array (well, another class, but it's a
classList, it's mainly an array).
I'm getting an error when I run the page:
"Cannot use a scalar value as an array", and "Call to a member function
on a non-object". The second is related to the first, as I'm calling a
function on the array value.
If it is possible, I probably coded something wrong. If that's the
case, I'll post some code.

View Replies !
Store A Array As A Variable
is there any way that i can store a array as a variable because i dont want to creat a database for thousands of variables. heres what i thought of so far

<?PHP
$arrayval = "1,3,2,7,4,6,8,15,12,78,96,1203,1029,39509,12999";
$array = array($arrayval);
echo $array[1],$array[3],$array[2],$array[5],$array[6],$array[4],$array[7],$array[9],$array[5],$array[10],$array[13];
echo "<hr>";
echo $arrayval;
echo "<hr>";
$sum = $array[1]+$array[3]+$array[2]+$array[5]+$array[6]+$array[4]+$array[7]+$array[9]+$array[5]+$array[10]+$array[13];
echo $sum;
?>

View Replies !
Store Array In Session
i store my shopping carts items in an array in a session like this Code:

View Replies !
What's The Best Way To Store An Array In The Database
I am trying to build a simple tree menu where the main items can be either a link or open up a subList of items which themselves can belinks or open into more submenus and so on.
An example is:

$ar = array(
'new_user' => 'newuser.php',
'tst1' => array(
'subtst' => 'subtstlink.php',
'subtst2' => 'sublink2.php'
),
'heyhey' => 'heyhey.php',
);

I am wondering what is the best way to store that in a mysql database (Both the item name and the link to it). Is there any php function that will allow me to make such an array into some sort of variable (String?) which can then be read easilly and made back into the array for manipulation and creation of the tree menu?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved