/    Sign up×
Community /Pin to ProfileBookmark

Mysql Pull Image

Hi,

I am trying to get a Recordset that when it says main_image it will go get that picture file from image_inventory/small I have tried several different ideas but non seem to work any ideas are greatly appreciated. Here is the Code that I have

<?php
if (!function_exists(“GetSQLValueString”)) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = “”, $theNotDefinedValue = “”)
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists(“mysql_real_escape_string”) ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case “text”:
$theValue = ($theValue != “”) ? “‘” . $theValue . “‘” : “NULL”;
break;

case “long”:
case “int”:
$theValue = ($theValue != “”) ? intval($theValue) : “NULL”;
break;
case “double”:
$theValue = ($theValue != “”) ? doubleval($theValue) : “NULL”;
break;
case “date”:
$theValue = ($theValue != “”) ? “‘” . $theValue . “‘” : “NULL”;
break;
case “defined”:
$theValue = ($theValue != “”) ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_….., $……..);
$query_Recordset1 = “SELECT * FROM sheet4”;
$Recordset1 = mysql_query($query_Recordset1, $…..) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>

<body>
<table width=”250″ border=”1″>
<tr>
<td colspan=”3″><?php echo $row_Recordset1[‘headline’]; ?></td>
</tr>
<tr>
<td width=”178″><?php echo $row_Recordset1[‘[B][COLOR=”Teal”]main_image[/COLOR][/B]‘]; ?></td>

////// This is where I want the image to pull through from image_inventory/small///////////////

<td width=”56″ colspan=”2″><?php echo $row_Recordset1[‘packing_slip_desc’]; ?></td>

</tr>
<tr>
<td colspan=”3″><?php echo $row_Recordset1[‘price’]; ?></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@shutterbugauthorFeb 17.2011 — Never mind I got it working.
×

Success!

Help @shutterbug spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...