ragekc Posted June 9, 2006 Share Posted June 9, 2006 HERE´S MY CODE:<? $hostname = "localhost"; $dbname = "bd_clientes"; $username = ""; $password = ""; MYSQL_CONNECT($hostname, $username, $password) OR DIE("Nao pude conectar"); @mysql_select_db( "$dbname") or die( "Nao pude selecionar o banco de dados"); $query = "SELECT MAX(codigocliente) FROM tblsorteio" ; $result = MYSQL_QUERY($query); $row = mysql_fetch_array($result); ?> <html><head><title>Resultado</title></head><body><center><h1>Lista de Pessoas Cadastradas</h1></center> <? echo $row[codigocliente]; ?> </body></html>NO RESULT IS SHOWN!!I GUESS THE PROBLEM MUST BE IN THE $row[codigocliente] PART..CAN SOMEONE PLEASE HELP ME??THAANKS Link to comment Share on other sites More sharing options...
ragekc Posted June 9, 2006 Author Share Posted June 9, 2006 PS: The names are exact as the database ... so thats no the error... Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 12, 2006 Share Posted June 12, 2006 You should enquote the name of the column you are printing, with single quotes <? echo $row['codigocliente']; ?> Link to comment Share on other sites More sharing options...
ragekc Posted June 19, 2006 Author Share Posted June 19, 2006 it still doesnt work =(((doesnt list anything...(blank) Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 19, 2006 Share Posted June 19, 2006 (edited) And what about the array fetch? Would it work if you change it to this? $row = mysql_fetch_array($result,MYSQL_ASSOC);Next, full PHP tags will always work, short ones only if the short tags are enabled, so if you'd use only full tags, you're always save <?php and ?> Edited June 19, 2006 by Dan The Prof Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now