Answer the question
In order to leave comments, you need to log in
How to fix the result of a selection from the database?
There is a working code for fetching data from the database.
$result=mysql_query("SELECT `time`,`currency_name` FROM `$table_name` where `time`>UNIX_TIMESTAMP(SUBDATE(CURDATE(),$show_graph_date_begin)) AND `time`<UNIX_TIMESTAMP(SUBDATE(CURDATE(),$show_graph_date_end)) $id_code ") or die (mysql_error());
if ($select_amt >0)
{
for($select_amt; $select_amt>0; $select_amt--)
{
$row=mysql_fetch_assoc($result);
$cryptocurrency_time=$row['time'];
$cryptocurrency_value=$row['currency_name'];
//....................
Answer the question
In order to leave comments, you need to log in
I have an idiotic question - what prevents you from normalizing the data in the database once, so as not to fence crutches?
Why did the name of the currency suddenly become a value?
Why in a field for storage of numerical values in general the text managed to be stored???
At the moment, the situation seems to me like this:
#define TRUE FALSE //happy debugging
For a crutch to solve the problem:
if (!is_numeric($cryptocurrency_value)) continue;
if (!is_numeric($cryptocurrency_time)) continue;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question