473,412 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

generating a select list from a database

Hi,
I'm trying to dynamically generate a html select list from a MS Access
database using the code below:

<?php
$conn=odbc_connect('customer','','')or die('Could Not Connect to ODBC
Database!');

$queryexe="SELECT * FROM types";

$rs=odbc_exec($conn , $queryexe)or die("Query failed: $sql<br />Error:
".mysql_error()."<br />");

echo "<SELECT name="typeId">";
while(odbc_fetch_row($rs))
{
echo "<option>".odbc_result($rs,"typeId")."</option>";
}
echo "</SELECT>";
?>

Its giving a sql error when i try it.
Can anyone help?

Nov 30 '06 #1
1 1084
On 30 Nov 2006 14:46:57 -0800, "Damo" <co***********@gmail.comwrote:
>$rs=odbc_exec($conn , $queryexe)or die("Query failed: $sql<br />Error:
".mysql_error()."<br />");
odbc_exec with mysql_error? You're mixing stuff up a bit there. Do you mean
odbc_errormsg?

$sql isn't defined either. Is this really the code you're running?
>Its giving a sql error when i try it.
You've forgotten to post the error...

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Holger Joukl | last post by:
You could use the str() builtin, returning the string representation of the list object: >>> params = (1, 2, 3) >>> "select * from T where C1 not in %s" % str(params) 'select * from T where C1...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
12
by: Martin_Hurst | last post by:
Has some one come up with a similar type script that could be used in a Postgresql database? The script below was created for a SQLServer database. Thx, -Martin ...
3
by: TS | last post by:
Hi all, I posted this question here before, but I'm still having a problem with this code. From my windows form, I opened a connection to a SQL database. I need to generate a combo box in my form...
4
by: rbronco28 | last post by:
I am pretty new at doing web development. I can make simple pages, but recently received a request from a small limo business I do web development for. We are currently working on a reservation...
1
by: sparks | last post by:
we are generating numbers for the data collection people. this worked fine for a while.. Private Sub generatenumber() Dim db As DAO.Database Dim rs As DAO.Recordset Dim StudentNumber As...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
1
by: sreedivya | last post by:
Hi, I am using Crystal Reports with .NET 2.0 for generating reports in my project. My database is SQLSERVER 2000. I want to display list of absentees between 2 given dates. For this I have written...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.