PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
rdionne1187
Forum Newbie
Posts: 17 Joined: Tue Feb 01, 2005 9:30 am
Location: CT
Post
by rdionne1187 » Mon Feb 21, 2005 5:58 pm
alrighty, I'm trying to assign parts of an array from mysql to a new array done like this,
Code: Select all
while($pn = mysql_fetch_array($result_numbers, MYSQL_NUM)){
foreach($pn as $value){
print($value.'<br>');
$partnumberї]=$value;
}
}
and you've gessed it, it doesnt work, the line print($value....... works but i cant get the partnumber to work. I'm tired, please help.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 21, 2005 6:01 pm
$partnumber doesn't work now?
print_r($partnumber);
rdionne1187
Forum Newbie
Posts: 17 Joined: Tue Feb 01, 2005 9:30 am
Location: CT
Post
by rdionne1187 » Wed Feb 23, 2005 1:01 pm
all of a sudden it works? im so confused!
rdionne1187
Forum Newbie
Posts: 17 Joined: Tue Feb 01, 2005 9:30 am
Location: CT
Post
by rdionne1187 » Wed Feb 23, 2005 7:15 pm
so confused i thought that it worked of course... can someone tell me how to assign variable arrays from mysql?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Feb 23, 2005 7:32 pm
I've posted this many times....
Code: Select all
$query = mysql_query($sql) or die(mysql_error());
while($resultsї] = mysql_fetch_row($query));
array_pop($results);
rdionne1187
Forum Newbie
Posts: 17 Joined: Tue Feb 01, 2005 9:30 am
Location: CT
Post
by rdionne1187 » Wed Feb 23, 2005 10:56 pm
thank you, you cant imagine how long it took me to figure out it puts the rows into $results[0][0] instead of $results[0], I was getting so frustrated