mysql

Why use mysqli_close() ?

Is there any reason why I should close the connection after a query or at the end of the script? What are the benefits of doing/no doing do? ...

Connecting to MySQL database with ASP on a virtualized Windows 2003 x64 server

Hi, I'm trying to connect to a MySQL 5 database using the MySQL ODBC 5.1 driver. In the control panel's ODBC settings I created and tested the ODBC connection and it's working fine. When I try to use the connection from VBScript code I get an error though: ADODB.Connection error '800a0ea9' Provider is not specified and there is no desig...

Is there a MySQL feature like SQL Server 2005's TRY/CATCH blocks?

I'm thinking about porting a database from Sql Server 2005 to MySQL. I've become accustomed to using SQL Server's TRY/CATCH block in stored procedures. Does MySQL have something similar, or am I going to be forced to go back to the old-school "check the error return after every statement, and issue a goto if it failed" style of progr...

Rescuing corrupted characters in database

I have just imported a huge MySQL database. Most fields are latin1_swedish_ci, and they contain lots of corrupted strings. e.g. Cavit Y�r�kl� instead of Cavit Yürüklü I have been trying to find a solution to fix these corruptions using PHP as thats all I know a little bit of. I have played unsuccessfully with utf8_(en|de...

Designing a database for user-customized groupings

A user can search for colours and add them to their palette.. So if they write blue, blue will show up and they can add it. so on with red, yellow....... But I want, that if they choose "dark colors", then grey black and brown should be added. Today I´m doing like this if($color==darkcolor) insert black and grey and brown... Is ...

Source install Apache 2.2.13 + PHP 5.3 + Snow Leopard

Can anyone direct me to or write their experiences installing Apache and PHP on Snow Leopard? I had this working in the past on Leopard, it would die after a security update, but was as simple as: $ ./configure --enable-layout=Darwin --enable-mods-shared=all $ make $ sudo make install and I was up and running again. Since the Snow L...

SQL Query, Selecting 5 most recent in each group

I have this table CREATE TABLE `codes` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `language_id` int(11) unsigned NOT NULL, `title` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `time_posted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 lan...

access + mysql converting to webplatform = (php + asp.net + mysql)?

i have a database that is written in access. the access mdb file connects via ODBC to a local mysql database. i have a bunch of sql and vba code in the access file. i dont expect the database to surpass 100mb. currently it is around 10mb. i will need to have multiple user access. (no more than 10 users at a time) i need to convert this ...

Mysql gem for Snow Leopard Install

Hey guys, I'm trying to get the mysql gem installed with a fresh install of Snow Leopard. I got mysql 5.1 x86 installed from mysql site, and have tried install the mysql gem using this command. sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config getting no love. this is my error. gcc -I. -I/us...

Django: How can you stop long queries from killing your database?

I'm using Django 1.1 with Mysql 5.* and MyISAM tables. Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queries out. I'm going...

Unable to understand this strange MySql client behavior.

I'm not sure what's going on here with the line art output by /usr/bin/mysql here. The problem: I'm unable to redirect the line art (used in creating the table columns) to a file! First, I do this on my terminal. [sd@host:~/tmp] $ mysql -usd sd -e 'select * from loan;' +---------+--------------+--------+ | loan_no | branch_name | am...

backing up mysql in wampserver

how can i backup my 10mb mysql database? i dont think wampserver supports mysqldump. i want to migrate it to a webserver. ...

creating db with myphpadmin

i have setup mysql on a webserver. i have an 8mb file with sql code to create tables. im using the phpmyadmin IMPORT FILE feature, but for some reason it gets stuck and gives me the 500 Internal Server Error The server has encountered an internal error or misconfiguration and was unable to complete your request. . what is the best way ...

which file location does myphpadmin look in?

for this statement: mysql <my_db_name> -u<user_name> -p<password> <mysql.sql where does mymphpadmin assume mysql.sql is located in? ...

MYSQL: How to copy an entire row from one table to another in mysql with the second table having one extra column?

I have two tables with identical structure except for one column... Table 2 has that additional column in which i would insert the CURRENT_DATE() I would like to copy all the values from table1 to table2. if i use INSERT INTO dues_storage SELECT * FROM dues WHERE id=5; it throws an error pointing out to the difference in the number ...

MySQL Int Removes 0

Hi I have got a column in my database which is set to Int. But my data always starts with a 0 so whenever I add a new record, it strips the 0 off and I don't want it to do that incase the first character has to be a 1 at some point. How can I overcome this issue? Is the best way to use VARCHAR any then validate using PHP? Update I...

MySQLMembershipProvider and MySQLRoleProvider not showing in ASP.NET Web Site Administration Tool

I have MySQL running with the ASP Membership Schema I have installed the connector, and have the following in machine.config: <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.0.4....

MySQL Changing from Null to Non Null

I have got a field that has been setup to allow for Null, but am now wanting to change that to not allow for Null. When ever I try to change this I can't because PhpMyAdmin has set all the previous records to Null. How can I fix this problem? Is there a query I could put that will remove all the Null values and set the field to Non ...

MySQL COUNT() and nulls

am i right to say COUNT(expr) where expr is not * will count ouly non nulls? COUNT(*) will always count all rows right? what if all columns are null? ...

Does MySql full text search works reasonably with none latin languages (Henrew, Arabic, Japanaese...)

Does MySql full text search works reasonably with none Latin languages (Hebrew, Arabic, Japanaese...) Addition: Did some tests... It has some problems with Hebrew. Example: The name מוסינזון is pronounced the same as מושינזון but searching one won't find the other, as this is a common spelling error in Hebrew, it seems I will have to...