btt50 Posted November 8, 2011 Report Share Posted November 8, 2011 Boas eu tenho este codigo e acho que ta bem mas da me este erro .$result = mysql_query("SELECT FROM videos,anedota WHERE semana='1'"); ->linha 63 while($row = mysql_fetch_array($result)) ->linha 64 { erro Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\index.php on line 64Ajudem me obg.. Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted November 8, 2011 Report Share Posted November 8, 2011 SELECT ??? FROMFaltou especificar o que você quer selecionar no select. Quote Link to comment Share on other sites More sharing options...
0 btt50 Posted November 9, 2011 Author Report Share Posted November 9, 2011 mesmo assim não funciona Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted November 9, 2011 Report Share Posted November 9, 2011 Usa o OR DIE(mysql_error()) para retornar o erro então.......semana='1'")OR DIE(mysql_error()); Quote Link to comment Share on other sites More sharing options...
0 btt50 Posted November 9, 2011 Author Report Share Posted November 9, 2011 dá isto :Column 'semana' in where clause is ambiguous Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted November 9, 2011 Report Share Posted November 9, 2011 Existe essa mesma coluna nas duas tabelas, então você tem que especificar em qual delas vai usar o filtro, tipo:videos.semana='1' Quote Link to comment Share on other sites More sharing options...
0 btt50 Posted November 9, 2011 Author Report Share Posted November 9, 2011 sim ok já percebi mas eu tenho 3 tabelas ir quero ir a essas 3 tabelas buscar o campo semana=1 como e que eu faço.. Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted November 9, 2011 Report Share Posted November 9, 2011 videos.semana='1' OR tabela2.semana='1' OR tabela3.semana='1' ... Quote Link to comment Share on other sites More sharing options...
0 Rogério Kleinkauf Posted November 9, 2011 Report Share Posted November 9, 2011 SELECT A.*, B.* FROM videos A,anedota B WHERE A.semana='1'; ) Quote Link to comment Share on other sites More sharing options...
0 MTavares Posted November 9, 2011 Report Share Posted November 9, 2011 Pelo que entendi, se você tem 03 tabelas e quer buscar informações nas três, com os mesmos campos e se houver relacionamento entre elas, você terá que usar um junção com INNER JOIN, LEFT JOIN, etc. e apelidar as tabelas: ex: tab.semana AS semana1, etc..abs Quote Link to comment Share on other sites More sharing options...
0 btt50 Posted November 11, 2011 Author Report Share Posted November 11, 2011 obg já funciona Quote Link to comment Share on other sites More sharing options...
Question
btt50
Boas eu tenho este codigo e acho que ta bem mas da me este erro .
erroAjudem me obg..
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.