ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm trying to create a web-based interface to an SQL database. First, it will display then name of the column. Then, if the user is editing a row that is a bool, it'll display a true/false/null listbox, and if it's text, it will display a textbox. phpMyAdmin is able to detect the name and data type, so I assume it is possible, but I can't find how on Goolgle.
If you want to use this SQL for many databases (i.e., not MySQL which I'm guessing you are using since afaik DESCRIBE is only in the MySQL spec), then DESCRIBE is not ANSI SQL standard compliant. In fact, there is no ANSI standard way of querying the column name and column data type via SQL that I know of. Why would your program need to know such things?
I want users to be able to add columns to a table and then input data into the table they created. Since I don't know what the name or type of the the column was that they created, I need to ask the database. At first I thought I could keep the name in the first row, but if it was numerical, that wouldn't work, and I would also need the data type in there, as well. I haven't decided exactly what I will do.
Thanks for the tip about the SQL standard. It's hard to keep track of that sort of stuff.
What language are you using? There might be an API call that allows you to obtain the structure of a given table without having to use SQL. Of course, you can just parse the returned values from the DESCRIBE call for MySQL.
As another alternative that could work for any DB system, you could just keep your own tables which describe your user-created tables for you. Kind of like the MySQL and SQL Server system tables, but in your own way so that it is stored the same for any DB backend.