![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello People, here is a problem I donīt know how to solve. I would appreciate some clue for it. In all my tables I use normally SELECT FIELD1,FIELD2...FIELDn from table and never I got a single problem. But there is a script where I canīt solve this one. This table has a BLOB field with pictures, so when calling SELECT * from TABLE it works ok, picture comes and display beautiful. But when I call SELECT FIELD1..BLOB,..FIELDn from TABLE it produces a "supplied argument is not a valid MySQL result " at mysql_fetch_array() command. It shows error exactly that way, with empty parentheses. Before you say "probably you didnīt pass all necessary fields" I reply just am using 4 fields, so its very difficult make mistake here, and also when you forget some fields MySql doesnīt produces error, instead giving an empty var. this piece of code works ok $Result = Mysql_Query("Select * From produto Where ID = '$XID' Limit 1 ",$db); $Myrow = Mysql_Fetch_Array($Result); $tamanho=$Myrow["TAMANHO"]; $FOTO = $Myrow["FOTO"]; $LOJA = $Myrow["LOJA"]; $COD = $Myrow["COD"]; but this code gets error $Result = Mysql_Query("Select TAMANHO,FOTO,LOJA,COD From produto Where ID = '$XID' Limit 1 ",$db); $Myrow = Mysql_Fetch_Array($Result); $tamanho=$Myrow["TAMANHO"]; $FOTO = $Myrow["FOTO"]; $LOJA = $Myrow["LOJA"]; $COD = $Myrow["COD"]; Thanks very much Mig |
#3
| |||
| |||
|
|
First of all, ALWAYS check the result of a mysql_query() call. *You're just assuming it works - and it isn't. mysql_query() is most probably returning false - in which case you need to determine why. *mysql_error() is a good place to start. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck... (AT) attglobal (DOT) net ==================- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
I discovered the problem, I think nobody here thought this would happen, but when you place the BLOB field at FIRST posicion , aleluhyah IT WORKS! , so the trick is to make SELECT BLOB,FIELD1,...FIELDn.... |
#5
| |||
| |||
|
|
Hello Sir, thanks very much, I discovered the problem, I think nobody here thought this would happen, but when you place the BLOB field at FIRST posicion , aleluhyah IT WORKS! , so the trick is to make SELECT BLOB,FIELD1,...FIELDn.... Mig |
#6
| |||
| |||
|
|
mig <m02041952 (AT) yahoo (DOT) com> wrote: I discovered the problem, I think nobody here thought this would happen, but when you place the BLOB field at FIRST posicion , aleluhyah IT WORKS! , so the trick is to make SELECT BLOB,FIELD1,...FIELDn.... This is nonsense. It does not matter at which place in the select list the blob field is located. XL I suspect a syntax error... |
![]() |
| Thread Tools | |
| Display Modes | |
| |