the value in the database is probably really 34.549999237061, regardless of what you see in phpmyadmin.
you can use money_format() or number_format() to display the value with only 2 decimal places.
if you want to REMOVE the first element and use it, array_shift()
http://php.net/manual/en/function.array-shift.php
$some_array = array('a', 'b', 'c');
$some_val = array_shift($some_array);
echo "some_val: $some_val"; // output: a
print_r($some_array); // output: b, c
probably somewhere above /home/username/public_html/col/proc1.php
if you can navigate to the location via command line, you can use the command pwd to 'print the working directory', or the absolute path to where you are.
many shared hosting plans allow you to place your own php.ini within the web server root.
the secondary option is usually to use .htaccess, often appropriate if your PHP is running as cgi.
this is because each time the function is called, it is 'reborn' with the reset array. this could be avoided by setting the array outside of the function and making it global inside the function... sort of making the function pointless.
after a quick read through, i have a couple thoughts/options:
1. instead of removing elements from the array, have a value to indicate whether they have been 'taken from the deck' or not.
maybe initialize the array like so:
cards = array("Ah"=>0, "Ac"=>0, etc...
then update value to 1 when card is 'taken'.
2. or randomize the deck array and use array_pop() or array_shift() to pull a card off of the end of the array.
/end 2 pennies.
because you do this once, before doing it again within a loop:
$row_sales_shipping_tax = mysql_fetch_assoc($sales_shipping_tax); // pull off first row of data
// ... then later
while ($row_sales_shipping_tax = mysql_fetch_assoc($sales_shipping_tax)){ // starts with second row
obviously, there is no record in the table login_details WHERE username='Mat' AND password='pie'
Perhaps there is a difference in capitalization or spelling, or there is additional space(s) on the values in the table.
this line causes the (assumed object) $result to be overwritten with $result->fetch_assoc(), so the next loop $result is no longer an object.
while($result = $result->fetch_assoc()){ // $result is no longer the object $result. Now it is the array fetch_assoc()
you need to use a different variable name for $result.
echo echo echo. echo values to see what they are.
echo $_POST['email'] to make sure it's what you expect.
after $check = "select id from users where email = '$email'";
echo $check to see if it's what you expect.
if mysqli_num_rows($check_result) <1
echo mysqli_num_rows($check_result) to see if it's what you expect.
basic debugging is called for!
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.