newbie error


Posted on 16th Feb 2014 07:03 pm by admin

what is wrong with this code ?

<html>
<body>

<?php
$conn=odbc_connect('Towel','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM Towel";

$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>ProductID</th>";
echo "<th>Name</th></tr>";
echo "<th>Dimensions</th></tr>";
echo "<th>Weight</th></tr>";
echo "<th>Color</th></tr>";

while (odbc_fetch_row($rs))
{
$ProductID=odbc_result($rs,"ProdcutID");
$Name=odbc_result($rs,"Name");
$Dimensions=odbc_result($rs,"Dimensions");
$Weight=odbc_result($rs,"Weight");
$Color=odbc_result($rs,"Color");

echo "<tr><td>$ProdcutID</td>";
echo "<td>$Name</td></tr>";
echo "<tr><td>$Dimensions</td>";
echo "<td>$Weight</td></tr>";
echo "<tr><td>$Color</td>";
}
odbc_close($conn);
echo "</table>";
?>

</body>
</html>

the file just doesn't show anything in Internet Explorer

No comments posted yet

Your Answer:

Login to answer
131 Like 24 Dislike
Previous forums Next forums
Other forums

Filling gaps in dates
So i'm doing a query for sales data and my return array looks like this

('date' => '20

max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i

Weird MySQL error, why am I recieving this?
PHP Code:


<?php require "global_settings.php"; ?>
<titl

unoconv doc convert to pdf code prob
PHP/5.3.1

Hi. I am trying to use this code to convert docs to .pdf utilizing unoconv. Howe

MS Access data into a html table
Hi everyone, I am quite a novice at php but I have created some helpful scripts that fetch data
f

Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,

The code below works great. It creates a table that shows the 25 most recently added t

Multi Dimensional Array Append
Hi Guys

I have a function that returns a multidimentional array eg

$result = functio

Escape Latin Characters
I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thoug

Display Database
I need to create a shopping cart. I found this code online: http://conceptlogic.com/jcart/
Unfort

Not showing whole name with mail () script
I sent up a simple mail form with the PHP mail() script. One problem is when it sends an email with

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash