mysql

Is there a way to set mysql variables using the JDBC Connector?

In Java, of course. I need to enable "force", but I have no idea how. I'm sure it might go somewhere in the URL, but I've tried a bunch of different things and looked for a bit on Google, to no avail. Thanks! ...

Problem creating a table using php..

Hello I am trying to create a table in MySql using php. My code looks like this: $sql = "CREATE TABLE qotwQuestion1111 ( QuestionId int PRIMARY KEY AUTOINCREMENT, Question varchar(5000), MemberId varchar(255) FOREIGN KEY REFERENCES qotwMember(MemberId), PostDate date, Vote int )"; mysql_query($sql,$con); i am unable to create this tab...

PHP Mysqli fetch_assoc

The MySQLi feature of PHP is great. Prepared Statements are great for injecting parameters in a query. However, if you use Statements, it seems you dont have access to the fetch_assoc feature anymore. You have to manually bind all your results. This mean my SQL query has to list all the fields, then I have to list all the variables in ...

Grab info between tags

I have a text file that has data wrapped between tags. The tags are: <title> <url> <pubDate> So, the entries look like this: <title>title 1</title> <url>url 1</url> <pubDate>pubDate 1</pubDate> <title>title 2</title> <url>url 2</url> <pubDate>pubDate 2</pubDate> <title>title 3</title> <url>url 3</url> <pubDate>pubDate 3</pubDa...

Visual Basic 2005 + mysql

How do i connect to mysql and get started with VB 2005? Been using PHP + MySQL in work for bout a year now. just wondering how to get started with Visual Basic 2005 + mysql. just to connect to a database, and run a simple select star query? Any helpers, or sample code welcome... db -> db_name table -> tbl_name ip -> localhost cheers la...

generating mysql statistics

I have a csv file, which is generated weekly, and loaded into a mysql database. I need to make a report, which will include various statistics on the records imported. The first such statistic is how many records were imported. I use PHP to interface with the database, and will be using php to generate a page showing such statistics. ...

I'm having problems with MySQL constraints

Hi guys. I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and 'link_item_store'. An Item can be in one or many stores, and one or many stores can have an item. Since this is a many to many relationship, I'm using 'link_item_store' to normalize. If I delete an item, I have to remove all instancs...

How do I log just the raw queries in MySQL?

I have my log file working, but I get extraneous info on each line like "29 Query", and I can't tell, but it looks like the queries logged are the interpretation of how MySQL treats each query internally. Is there a way to automatically log each query as they were executed by the application without any additional information added to th...

Is there something analogous to a split() method in mySql?

I'm looking to write a stored procedure that takes as a parameter a string that's delimited by a token and then to run a while loop in the procedure for every item in that string. I'm not seeing anything in the mysql documentation that would accomplish this task... is there a way to do this? ...

displaying AJAX based Please Wait on multiple pages

I am making a data entry form in php/mysql. There i have added many dropdowns and auto complete textboxes, which query the database asynchronously and fetch the data. I wanted to inform the user that some kind of interaction between client and server is been taking palce, so i placed an element in hidden form <div id="wait" style="back...

How to send jquery $.post with alert

Hi All I have a problem with following script. It generates a list of places which are editable, deletable or you can even create a new one. I want to send a $.post request when creating a new place to a php file which makes an entry into a database (MySQL) and then lists this entryes in html. Now why doesn't even the $.post send an a...

How to take complete backup of mysql database using mysqldump command line utility

Hi All, Can anyone provide any input on how to take complete backup of mysql database using mysqldump. when I am taking backup my tables from specified database are only getting backed up not the procedures and functions. Here's the backup command I am using : Operating system i am working on Windows Vista mysqldump -u username -p db1...

MySQL "inserts" speed difference between production and local environment is too big!

Hi, I have installed MySQL 5.1x instance on a Linux machine (768MB RAM). I restored a backup of about 1000 rows and through my .NET application (deployed on a different Windows webserver) I performed certain read operations, which, when considering that the table had no indexes, were fast. I then cleared the server from these rows and ...

See if lat / long falls within a polygon using mysql

I have the created the table below CREATE TABLE geom (g GEOMETRY); and have inserted many rows, example below: INSERT INTO geom (g) VALUES(PolygonFromText('POLYGON(( 9.190586853 45.464518970, 9.190602686 45.463993916, 9.191572471 45.464001929, 9.191613325 45.463884676, 9.192136130 45.463880767, 9.192111509 45.464095594, 9.192427961 4...

replace exact match in php

im new to regular expressions in php. I have some data in which some of the values are stored as zero(0).What i want to do is to replace them with '-'. I dont know which value will get zero as my database table gets updated daily thats why i have to place that replace thing on all the data. $r_val=preg_replace('/(0)/','-',$r_val); Th...

Mysql join syntax

If I want to perform joins on 3 or more tables, what is the best syntax? This is my attempt: Select * from table1 inner join table2 using id1, table2 inner join table3 using id2, table3 inner join table4 using id4 where table2.column1="something" and table3.column4="something_else"; does that look right? The things I'm not sure ...

creating mysql dump like phpMyAdmin

I have a scripts that retrieves huge data on a table. I want to create a mysqldump to insert data into another database table with different fields. I want the format of phpMyAdmin where it repeats the INSERT INTO Table VALUES(values1),(values2), ...(values100); if reaches certain amount of value sets depends on what you set. ex: If I ...

Multiple items in a single MySQL row?

Using MySQL + PHP, I want to store several food_items for a single restaurant order in a MySQL database. I have two tables: orders & food_items: Many food_item_ids will be stored for a single order. I'm just wondering, what's the best approach to storing the food_item_ids in the orders_table? Should I store each food_item_id in a sep...

NHibernate mysql connection not closed?

I am using NHibernate with mySQL 5 and I am a bit unsure whether NHibernate really closes the connection to mySQL. This is the code I am using in order to save a Player entity to the database: using (ISession session = SessionFactory.OpenSession()) { using (ITransaction transaction = session.BeginTransacti...

How to restore mysql database

Hi All, I have taken the backup of mysql database but when I am trying to restore it my stored procedures are not getting restored. Is there any way like for backup we use --routines in mysqldump command. Can we do any such thing in mysql. If I am using mysqldump then it is just dumping mysql tables but if I am using mysql command to ...