mysql4

MySQL Alter syntax to drop a column if it exists

What is the syntax to drop a column in a MySQL table, if that column exists on version 4.0.18? ...

MySQL And C applications

When building a application that accesses a MySQL database on linux using C/C++ i have to dynamically link into the mysql client library. Is there a way in which i can statically link the application so that the mysql client libraries are no longer required? What is the best practice, with regards to C\C++ development, to include rathe...

C MySQL client library behaviour

I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all the results that is in the database. This issue happens sometimes, mostly when servers hav...

updating primary key of master and child tables for large tables

Hi, I have a fairly huge database with a master table with a single column GUID (custom GUID like algorithm) as primary key, and 8 child tables that have foreign key relationships with this GUID column. All the tables have approximately 3-8 million records. None of these tables have any BLOB/CLOB/TEXT or any other fancy data types j...

MySQL: Migrating Queries from v4 to v5

When migrating a project from MySQL 4 to MySQL 5, what are the primary things I need to address in order to ensure queries remain compatible? In general things should be fine, but I know that some things that worked implicitly in MySQL 4 queries have to be defined explicitly in MySQL 5 (but I can't for the life of me remember what exaxt...

Difference between php 4 and php 5?

I'm in search of the web hosting space, and got to know the PHP version is 4.3 and MySQL Version 4.1 But i developed my application in MySQL version 5.x and PHP version 5.x Can anyone give me the differences in versions ? what all i cannot access now ? Thanks... ...

Drop constraints only if it exists in mysql server 5.0

i want to know how to drop a constraint only if it exists. is there any single line statement present in mysql server which will allow me to do this. i have tried the following command but unable to get the desire output alter table airlines drop foreign key if exits FK_airlines; any help to this really help me to go forward in mysql...

Need MySQL 4 to ignore ALTER TABLE errors

I have a MySQL script which is executed automatically under certain conditions. That script executes an ALTER TABLE command, because that column is needed in the database, but it may or may not have it... Is it possible to make MySQL 4 execute the ALTER TABLE statement if the column doesn't exist or ignore the duplicate column error for...

Fastest way to join mysql 4.0 data from multiple tables?

Hi, I have 3 mysql 4.0 tables: all have fields ID(int), type(int) and another field, value which is either varchar(255), tinyint or int. I need to write them all out and I end up getting three DataTables, looping over them, and creating rows into a temporary table (in .NET 1.1). Do you see any faster/cleaner way than this to join or ju...

MySQL: select distinct names for each date?

Say I want to select rows with a date range or date_feild > 2009-06-01 && date_field < 2009-07-01. and I want to select the first_name_field and last_name_field but I only want the same name (F+L) to show up once per date. So the same name can show up, multiple times as long as their dates are different; but not if the names are on the s...

PHP: keep track of requests by user and by product brand?

I have a MySQL table that has price requests in it, it has date, first, last, and product_id fields. The product brand can be found from the product table from the product_id. Given a date range, they want to know the total number of requests, by people and by brand for each day in the date range, and total for date range. Here is the t...

Is it possible to have a mysql table refer to a table in a foreign database?

Is it possible to use a mysql table transparently though the table is an alias for a table in a foreign database? ...

Create table trouble in MySQL 4.1

The column which defined with char type in a create table sentence is defined as varchar() It was defined as char(8) convert to varchar (8) in desc on DB. char(1) -> char(1) on same DB When it defined a table of the char type more than 2 bytes, to convert for varchar() is specifications in MySQL 4.1? ...

Not your usual MySQL4 + ODBC connection issue...

I've got a problem with ODBC that has me stumped, and I can't find an answer anywhere that addresses my problem. Short version: I can't connect to my MySQL4 installation on Ubuntu Jaunty from my WinXP ODBC System DNS, even tho I can connect just fine using the command line client both on that particular machine and others. Huge amoun...

Can user defined variable be used with ADODB connections from PHP5 to a MySQL4.x server?

I'm trying to execute a SQL statement using the ADODB PHP library against mySQL4.1 : $rs = $db->execute("set @name = ?; select @name", array('test')); but it does not seem to like this. Is it possible to use variables with prepared statements? ...