mysql

MySQL Crashed Table Unable to save result set

I have a crashed table which I am unsure how to repair with. Here is the dump of my error trace. Warning: mysql_query(): Unable to save result set in C:\Users\programmer\workspace\DBMigration\functions.php on line 10 MySQL Query Failed! 1194: Table 'exp_weblog_titles' is marked as crashed and should be repaired ...

How to count diffrent rows in MySQL ? (three columns as a whole)

How to count rows with distinct values on any of the three columns: col1, col2, col3? ...

MySQL Using a string column with date text as a date field

I am doing a database migration and I currently have a string column with dates (versus having the optimal datetime field set for these). Is there a function I can call in MySQL to convert this field to a datetime so I can use the date features such as before this date or after this date? ...

database search question PHP

hi my code is this, $query = "SELECT * FROM `cars` WHERE (color LIKE '%". $key ."%' OR name LIKE '%". $key ."%') AND enabled = 'yes' ORDER BY `ID`"; database is like this ID color name enabled ---- ------ -------- --------- 1 red red car yes 2 blue blue car yes 3 ...

Problem with adding rows with JDBC and MySQL?

I'm using JDBC in sync with MySQL to add and define rows to a MySQL database's Table. The problem is that I don't know why it is throwing an Exception when I use methods from the ResultSet class to add rows to the table. Bear in mind that I've earlier tried just reading the table via ResultSet methods, and, it successfully printed out th...

how would one create a jquery modal dialog pop confirmation box after submission

hey everyone! i am currently working a edit and delete pages for a company database. edit.php right now i am trying to get php to check that a form has been successfully submitted (it POSTs to itself) and once this check is done then it would render a jquery modal box informing the user that the form has been successfully edited. de...

security issues in Login registration system using php javascript mysql

I am building a web application from scratch that has registration and login functionality. I am completely a novice when it comes to security issues and attack like mysql injection. Apart from encryption of password in database, what are other security issues that i have to worry about?? And how do i take care of them?? Thank you ...

Building app to Classify / Describe Products - Overwhelmed somewhere between planning & execution

Greetings! I recently started working for a company that carries a line of 20,000 Surgical Instruments. Our data on all items is currently spotty and chaotic at best. I intend to fix this. I have been tasked with redesigning the web site. As part of the project, I'm building an app to classify and describe all products. We don't do any...

How to 'undo' this small function in PHP?

I am using this to adapt my text which then gets inserted into a mysql db: $ad_text=nl2br(wordwrap($_POST['annonsera_text'], 60, "\n", true)); When users wish to change their posting, they click a link on my page, and a form opens. In this form, the textarea where I fetch the info from mysql, I am displaying the text again. Only probl...

MySQL Master and Slave with vastly different execution plans

I have a complex MySQL query that joins three tables and self-joins one table to itself. There is a Master and a Slave that have identical data and indices. The Master is a powerful box compared to the Slave, yet the query runs 10x faster on the Slave (during a period of light load for the Master). The execution plans are vastly diffe...

How to insert shapefiles into a MySQL database?

I am trying to find this shp2mysql tool. But all I found was a PHP implementation. There is any other version available in the internet? ...

Where to close a JDBC Connection while I want to return the ResultSet

It seems that the resultSet will be automatically closed when I close the Connection. But I want to return the rs and use it in another method,then I don't know where to close conn and pstmt. public ResultSet executeQuery(String sql, String[] getValue) { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null;...

MySql: Query multiple identical dynamic tables.

I have a database with 500+ tables, each with identical structure, that contain historical data from sensors. I am trying to come up with a query that will locate, for example, all instances where sensor n exceeds x. The problem is that the tables are dynamic, the query must be able to dynamically obtain the list of tables. I can query ...

MySql: Count rows in price range?

If I wanted to know how many entries I have where product_price is within the 500-1000 range. How can I do that? Thanks! ...

-bash: ./configure: No such file or directory - MySQL install on Mac OS X 10.6

I'm trying to install MySQL on Mac OS X 10.6. After I download MySQL and untar with tar xzvf mysql-5.1.37.tar.gz I then try and run this configure line: ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-shared --with-plugins=innobase I get the error -ba...

Can't change MySQL password

I installed MySQL, and the installation requires a password. I didn't want to enter one, but I had to to click "Next" and finish the installation. So, I tried to change it. In the cmd prompt: C:\>mysql -u root -p Enter password: ** mysql> use mysql; Database changed mysql> select `password` from `user` where `user` = 'root'; That ...

PHP MySQL database strange characters

Hello, I'm trying to output product information stored in a MySQL database, but it's writing out some strange characters, like a diamond with a question mark inside of it. I think it may be an encoding/UTF8 issue, but I've specified the encoding I want: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Is this rig...

MySQL 5.5 for windows?

Today version 5.5 was released but all the official builds in the mysql website are for linux. does anybody knows when windows downloads for this release will be available? ...

How to pass a MySQL database function as a query parameter from c#

Let me explain a little. Image you have the flowing MySQL table: CREATE TABLE test ( value DATETIME ); Currently I am doing something like this: command.CommandText = "UPDATE test SET value = ?value"; command.Parameters.AddWithValue("?value", DateTime.Now); But the clients date/time settings are unreliable so I would like the ti...

Slow mysql query. Any tips?

I have the below query... It works but it runs extremely slow. Was hoping someone might be able to give me a few tips to improve execution time? SELECT tb_clients.*, tb_clients_phone_fax.* FROM tb_clients, tb_clients_phone_fax WHERE tb_clients.client_id=tb_clients_phone_fax.client_id AND MATCH (client_company,client_description,client_k...