Why is this code generating an error when it outputs a
valid SQL statement? (there are no parse errors)
//$find is text box input
$wordsarray = explode( ,$find);
$sql = SELECT bandname FROM bands WHERE (bandname
LIKE ;
$i = 0;
while ($i count($wordsarray))
{
$word =
I am inserting binary image data into a mysql table (mediumblob).
Actually, what goes into the table is the /tmp... pathname.
This is the code I used to try to retrieve, but I get Resource ID#2
$get=mysql_query(SELECT bin_data FROM binary_data WHERE id=$id);
printimg src=$get;
=
Mark
Thanks, David. That helped a little but now what I get is:
img src=/tmp/phpMVWr5Z in the output.
The tmp folder is up the directory tree outside of my www folder (on my
web host's 'puter)- I don't have direct access to it.
Heres the modified code:
$sql=mysql_query(SELECT bin_data FROM
Heres what I'm trying to do:
$data=addslashes(fread(fopen($form_data, rb), filesize($form_data)));
//some lines of code edited out
$result = mysql_query (
UPDATE bands, binary_data
SET genreid='$genre', bandname='$name', bandesc='$description',
bandurl='$url', bandemail='$email',
I cannot seem to get a SELECT COUNT for a query from fields in two different tables
and a WHERE clause. Does anyone know if this is not possible with php/mysql or am I
doing something wrong? I have tried a number of variations on the following code:
$sql = SELECT COUNT(*), bandid, bandname,
Yes, query is definitely working without COUNT(*). Even in the most stripped down
form, the query fails:
$sql = SELECT COUNT(bandid), genre
FROM bands, genre;
$result=mysql_query($sql);
while ($gen=mysql_fetch_row($result)) {
echo $gen[1];
}
John W. Holmes [EMAIL PROTECTED] wrote:
Mark Gordon