Say I have this array for example:
print_r($array);
Prints:
Code: [Select]Array
(
[0] => Array
(
[status] => 0
)
[1] => Array
(
[status] => 1
)
[1] => Array
(
[status] => 0
)
)
Now I have another array:
$color_array = array('0'=>'nocolor','1'=>'green');
How I can do the logic of this?
foreach($array as $tmp){
// Say status holds "1" in this case so it translate to
//$color_array[1]; = green
echo "{$color_array[$tmp['status']]}";
}
Obviously the above generate Illegal offset type. So I cant do that.
Fetching array then reversing it
Hi, I have a simple problem, I'll try to explain it as best I can:News entries in my database are ordered from oldest to newest. In order to pull out the last 10 lines I do
$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, For Example:Goto: http://ucp.south-westrp.com/UCP.phpType Username: Comptons_Eazy_EAnd Password:
why this query can delete duplicates ?
why this query can delete duplicates ? Anybody can give me the detailed explanation ?
Update Myspace status with CURL
Logging in:Code: <?phpclass Myspace{ function login($username, $password) { $username = $_POST['user']; $password = $_POST['passwd']; $login_url =
Inserting a check in checkbox from array value
Hello all,I have a bit of code that works for a select option box, but does not work for my checkboxes. I need multiple selections on this code and I really don't like the look of multiple select
Count
Getting the same count everytimeCode: $visitquery = mysql_query("SELECT COUNT(*) FROM visitors WHERE ownerkey = '$uuid' & region = '$selected' AND `date` < DATE_ADD(CURDATE(),
Help with email validation please...
Hi, Please could you help. I have a register.php login page where users register, the details are then logged into a temporary database, the user receives an email to verify their email address and
Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.It'll do the query and then do..$views = $row['views'] + 1;Then insert $views into the database.This updates the view for each refresh of
If a form submits back to same page do you need to use $get
IM trying to pass page number and year that was selected back to the same page.i have this code Code: echo '<form action="archivedBookings.php" method="get">';
Require select-option functionality in Module Pool Programming
Hi Gurus,