0
I made a page of Admin for a website and when I climbed on the server I found out that the PHP version is 5.2 and there is no way I can update, the server always introduce me error in function mysql_fetch_array()
, i wonder if you have an equivalent function for php 5.2 and if PDO could solve my problem?
That’s the code I made:
$selecao = mysql_query("SELECT * FROM nome_table WHERE nivel = 'Cliente'
ORDER BY nome_contato");
while ($selecao_dados = mysql_fetch_array($selecao)) {
echo $id = base64_encode($selecao_dados['id_user']);
}
The mistake:
I believe that PDO would solve, but your code we can not know, as Mutley said, but I also found a topic on this subject -> http://stackoverflow.com/questions/11004500/is-mysql-fetch-array-supported-in-php-5-2-6
– Rafael Withoeft
You could provide some code for us to help, too.
– mutlei
<?php $selectao = mysql_query("SELECT * FROM name_table WHERE nivel = 'Client' ORDER BY name_contact"); while ($select_data = mysql_fetch_array($selected)) { echo $id = base64_encode($selected_data['id_user']); } ?>
– mikaellemos033
Related: Update old code to PDO
– rray
Ask [Edit] the question and put the code there.
– Jorge B.
http://meutema.hol.es/img/error.PNG
– mikaellemos033
This error means that the query failed, the value of
nivel
came blank.– rray
On the line of
mysql_query
, in place of;
put this code,or die(mysql_error());
and see if another error appears.– rray
Take a look which may be the same problem as yours: http://stackoverflow.com/questions/11004500/is-mysql-fetch-array-supported-in-php-5-2-6
– Marcelo Diniz