Re: I am confused to mysql_query.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sichta,

That's what I am confused. Quoted or no Quote makes no effect. mysql_query does not work.

I tried to debug with "..or die (mysql_error());" but it seems "mysql_error()" does not exist anymore.

Please keep telling me. I've wasted to much time today hanging around with this weird problem.
====
On Wed, 1 Aug 2007 08:27:51 +0200
"Sichta, Daniel" <Daniel.Sichta@xxxxxxxxxxx> wrote:

> Hi ,
> 
> Try this:
> 	$hsl=mysql_query($stringsql,$koneksi); 
> 
> DS
> 
> -----Original Message-----
> From: Patrik Hasibuan [mailto:patrikh@xxxxxxxxxxxxxxxxxxxxx] 
> Sent: Wednesday, August 01, 2007 8:23 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  I am confused to mysql_query.
> 
> Dear my friends...
> 
> This sql string produces proper output in my MySQL-Query:
> select image_src from products where product_id='10';
> the output is:
> gambarproduk/0/10/1.jpg
> 
> But my php code does not produce anything.
> 
> Please tell me what is my mistake.
> ===
> <?php
> if (isset($pid)){
> 	$koneksi=mysql_connect("127.0.0.1","root","mysuccess");
> 	$stringsql="select style, 
> 						description,
> 						price 
> 					from styles 
> 					where product_id='$pid';";
> 	$hsl=mysql_query("$stringsql","$koneksi");
> 	while ($brs=mysql_fetch_row($hsl)){
> 		list($edisi,$deskripsi,$harga)=$brs;
> 	}	
> 	
> 	$konek=mysql_connect("127.0.0.1","root","mysuccess");
> 	if ($konek){ 
> 		echo "konek berhasil <br>";
> 		$sqlgbr="select image_src 
> 					from products 
> 					where product_id='$pid';";
> 		echo "$sqlgbr <br>";
> 		$hslgbr=mysql_query("$sqlgbr","$konek");
> 		if (!$hslgbr){ 
> 			echo "query gambarproduk tidak berhasil <br>"; 
> 		}elseif ($hslgbr){
> 			echo "array gambar";
> 		}
> 		while ($brsgbr=mysql_fetch_row($hslgbr)){
> 			list($gambarproduk)=$brsgbr;
> 			echo "urlgambar: $gambarproduk <br>";
> 		}
> 	}
> }	
> ?>
> ===
> -- 
> Patrik Hasibuan <patrikh@xxxxxxxxxxxxxxxxxxxxx>
> Junior Programmer
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


-- 
Patrik Hasibuan <patrikh@xxxxxxxxxxxxxxxxxxxxx>
Junior Programmer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux