KBBach
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by KBBach
-
-
Hum well...
I can see the logic..
But I'm working on the getProdImage and can't get it working...
getting following error:
Parse error: parse error in C:\wamp\www\MedTech\getProdImg.php on line 3
Well here's my code:
<?php error_reporting(E_ALL) $con = mysql_connect("localhost","reader","reader"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("medtech", $con); if(isset($_GET['id'])) { $id=$_GET['id']; $img = mysql_query("select PIC from products where ID="+$id); echo $img; } ?>
Anyway.. .The Databse ID is simply called ID and the largeblob with the image is called PIC...
-
Sooo.... what I need to do is to make a page that does nothing but getting the image from the sequel server and then link to that page?
Errhmm how do I carry over the ID (unique identifier) from the products.php to the getProdImg.php to get the right image?
-
Hi!
I'm trying to store images in the largeblob format on my sql server (wamp-server) and then displaying them on a PHP site, but pretty much nomatter what I try it seems that php vomits..
I've tried different image (jpg/jpeg) files but I think phpmyadmin screws them up or something..
Anyway...
here's the code:
<head> <title>Med-Tech.dk<title> <link rel="stylesheet" href="css/style.css" type="text/css"> </head> <body> <html> <table class="main"> <tr> <td class="banner" height="120px"> <div id="banner"> </div> </td> </tr> <tr> <td> <div id="links"> <a href="index.php">Home</a> | <a href="products.php">Products</a> | <a href="contact.php">Contact</a> </div> </td> </tr> <tr> <td> <div id="bodytext"> <?php $con = mysql_connect("localhost","reader","reader"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("medtech", $con); $result = mysql_query("SELECT * FROM products"); while($row = mysql_fetch_array($result)) { echo '<table class="products">'; echo '<tr>'; echo '<td colspan=2>'; echo '<h1>'; echo $row['Name']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td width=200>'; #echo 'billede her'; header('Content-Type: image/jpeg'); echo $row['PIC']; echo '</td>'; echo '<td>'; echo $row['SDesc']; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td colspan=2>'; echo '<h3>'; echo $row['ArticleNR'] ; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td colspan=2>'; echo $row['Desc']; echo '</td>'; echo '</tr>'; echo '</table>'; } mysql_close($con); ?> </div> </td> </tr> </table> </html> </body>
Any wise words would be appreciated - I've been working on this all day and my sanity is balancing on the edge of a knife...
[SOLVED] Largeblob image from mysql to website - corrupted?
in MySQL Help
Posted
So now it's working ^^
Thanks you both so much for your help!!!!
Just to summerize :
Products.php
getProgImg.php:
This is for a school project, so I really wanna credit your guys!
You can send me some info on whom to credit on a pm