Explode() in sql?
Posted: Thu Jan 04, 2007 2:22 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
The Following code will not show the rows of information on my page after the header. is it not pulling it out of the database? i know its putting it in the database at least. in the data base on that table i have 3,2 which is the corrisponding information that is supposed to go in the database on the implode. but why wont it explode that same data? Please someone help me i've been beating this script up all day.
Thnx,
PhP_ColdFusionCode: Select all
// if edit => Print
case 'Print':
if (isset($_POST['select'])) {
$Printed = implode(",", $select);
}
$Printed2 = explode(",",$myrow["Print"]);
$sel = "UPDATE print
SET Print = '" . $Printed . "'
WHERE Num = '1'";
$sel2 = "select *
FROM products
WHERE ProductID = '" . . "'";
$result = mysql_query($sel,$con);
if (!mysql_query($sel,$con))
{
echo '<tr>';
echo '<td><CENTER>';
echo 'Error: ' . mysql_error();
echo '<br><a href="javascript:history.go(-1);">Go Back</a>';
echo '</td>';
echo '</tr>';
die();
} elseif (mysql_query($sel,$con)) {
echo '<frame width=600>';
include 'templates/paperhead.php';
while($row = mysql_fetch_array($result))
{
echo '<tr>';
echo '<td style="border:none;">'.$row['ProductID'].'</td>';
echo '<td style="border:none;">'.$row['category'].'</td>';
echo '<td style="border:none;">'.$row['Supplier'].'</td>';
echo '<td style="border:none;">'.$row['Serial'].'</td>';
echo '<td style="border:none;">'.$row['Product'].'</td>';
echo '<td style="border:none;">'.$row['Description'].'</td>';
echo '<td style="border:none;">'.$row['LeadTime'].'</td>';
echo '<td style="border:none;">$ '.$row['UnitPrice'].'</td>';
echo '<td align=right style="border:none;"> '.$row['UnitsOnHand'].'</td>';
echo '</tr>';
}
echo '</frame>';
die();
}
break;
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]