mysql

php, mysql: compare strings - accent sensitive and case insensitive

hello guys! i need to perform a name search in the database based on a set of keywords. the result should be accent sensitive and case insensitive. following the solution i found here plus few modifications to allow case insensitivity, i used the following code: $sql = "SELECT name FROM table_names WHERE LOWER(name) LIKE _utf8 '%".str...

how to fast copy a large innodb table

how to fast copy mysql innodb table size 8.4G? ...

something wrong with this jquery?

i have these two jquery scripts on my html page, one of them loads more results(like pagination), and the other one replies to users messages, just like twitter! the replies works(inserts username into textbox), when the page is on default, but when i load more results, the loaded results wnt insert the username into the textbox!! these...

How can I automatically escape quotes in content when exporting from MySql to an sql file?

We have a Joomla website which we want to copy over to another host website. So far everything has been copied except for the database. The problem we're experiencing is as follows: After exporting the database information from our old website into an .sql file and trying to import it into an empty database on our new host, it seems tex...

Saving value as a variable name in database

Database Table company_info ----------------------------- | companyname | companytype | ----------------------------- | Company One | Blah | ----------------------------- | Company Two | Blah2 | ----------------------------- Database Table invoice_template ----------------------------- | Header | bgcolor | -----...

do you table can be as IN procedure in mysql?

do you table can be as IN procedure in mysql? ...

Optimal Storing of Cache File References with Cache Tags in MySQL

Background I've got a complex page caching system in place. Every database item that is used on a page stores a reference related to the item and the cached page. Below is the database table used to store those cached references CREATE TABLE `sacrifice_cache` ( `cache_id` int(21) NOT NULL AUTO_INCREMENT, `cache_page_id` varchar(255...

PHP - How to hide URLS in MYSQL?

How to hide URL's in MYSQL but readable with curl and PHP? E.g. Obfucation or anything to hide those URL's. ...

Execute Batch of MySQL Statements through ODBC Connector when calling from excel

I'm trying to execute multiple statements on a MySQL server and get the results into an Excel pivot table. As an example: create temporary table if not exists a select 1 as testcol; select * from a; Even if I have the MULTI_STATEMENTS flag set to 1 it returns a "problem obtaining data" error. Is there a way to do this? It's a read-o...

MySQL database-design question

Situation Say I have the following: a table items a table lists to which these items can be linked a table users Condition: a list can belong to all or one specific user What I'd like to do is create "global" lists that exist for ever user. But there should be a possibility to "overwrite" this global list with a user-specific one. E...

How do you create an index across different tables

Table A consists of (id, fieldA, fieldB, fieldC, fieldD) Table B consists of (id, tableA-id, fieldE, fieldF, fieldG) My queries looks like this:- 1. select * from tableB b, tableA a where a.fieldA=? and a.fieldB=? and a.fieldC=? and a.fieldD=? and (b.fieldF >= '09/01/10' and b.fieldF <= '09/30/10'); 2. select * from tableB b, ...

Connecting to MySQL on a different server

Hi, I have two servers (virtual machines - I can remotely connect to these) - server 1, and server 2. On server 1 I keep my webpages, and on server 2, I keep the databases. I am currently trying to connect to a database on server 2 from server 1. Here is my php code: <?php $dbhost = 'xxx.xx.xx.xx:xxxx'; $db...

How do I design a Localised Content table that can join to a number of different tables (the relationship needs to be generic...)

I know that this isn't exactly normalised, but bringing all of the localised data throughout my application into just a few tables will help me out a lot. I have to be able to link some generic table to a LocalisedContent table which will contain different rows for each of the localised key-value pairs of the generic table joined to it....

MySQL: SHOW TABLES only returns the first table

I am using SHOW TABLES to retrieve a list of tables in the DB. The DB has 19 tables $db = mysql_connect($dbhost, $dbuser, $dbpassword); if (!$db) { die('Could not connect: ' . mysql_error()); } $dbselect = mysql_select_db($dbase,$db); if(!$dbselect) { die('Could not connect: ' . mysql_error()); } $c_query=mysql_query("SHOW TABLE...

Dealing with dates in mysql?

EDIT: changed the whole question sorry, im trying to deal with the mysql DATETIME values, this is my mysql query: $result="SELECT u.username, u.picture, m.id, m.user_note, m.reply_id, m.reply_name, m. m.dt FROM relationships r, notes m, user u WHERE m.user_id = r.leader AND r.leader = u.user_id AND r.listener ='".$_SESSION['user_id']."'...

MySQL returning results from one table based on data in another table

Before delving into the issue, first I will explain the situation. I have two tables such as the following: USERS TABLE user_id username firstName lastName GROUPS TABLE user_id group_id I want to retrieve all users who's first name is LIKE '%foo%' and who is a part of a group with group_id = 'givengid' So, the query would like somet...

mysql delimiter question

How do i do this: mysql -u myuser -p mydb -e "select f1,f2 from mytable" > /tmp/mydata.txt But I want to separate the fields with a comma. mysql --delimiter=, -u myuser -p mydb -e "select f1,f2 from mytable" > /tmp/mydata.txt Does not work :( ...

Using php to connect to mysql using mod_dbd

Hi, I would like to use mod_dbd to implement connection pooling for my php application. I am able to define the mod_dbd module for apache and I can see the connections that it is opening, but I am not able to "hook on" those connections with my php code. I was trying mysql_connect with parameters and without as well as mysql_pconnect. W...

relating to a new table in mysql

Hi friends, I have just added a 'groups' table to mysql database. I already have a member table that has a group_id field. Should I relate member members of members table to different groups in php or mysql? Please it would help a lot if you can give me some example code. ...

storing negative number in decimal field of mysql table as of version 5.0.3

Hi, My table has few fields with an amount column of type decimal. This column will have either a deposited amount (a positive value) or a withdraw amount (a negative value). I store the positive value as just 120 and the negative value as -50. I sum the column and got the result as expected. Mysql version is: 5.1.33-community. When i ...