mysql

mysql-python static linking on Linux 64-bit

Has anyone tried to statically link mysql-python with mysql client library on 64-bit Linux? gcc -pthread -shared build/temp.linux-x86_64-2.6/_mysql.o /home/apy/MySQL- python-1.2.3c1/mysql-5.1.42/i/lib/mysql/libmysqlclient_r.a -L/home/apy/MyS QL-python-1.2.3c1/mysql-5.1.42/i/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl - lm -lp...

MySQL Fulltext keyword order?

I am making a little search algorithm at the moment, and I am wondering if MySQL fulltext searches weight keywords in order of appearance? For example: Search Term: php macaroni pizza custard In a fulltext search, is PHP more "relevant" than custard? Or are they both equal? ...

Accented characters stored in MySQL database

Hi, I have a webapp that stores French text -- which potentially includes accented characters -- in a MySQL database. When data is retrieved directly through PHP, accented characters become gibbirish. For instance: qui r�fl�te la liste. Hence, I use htmlentities() (or htmlspecialchars() ) to convert the string to html entities, and all...

Get column heading names from MySQL result in Ruby

I'm using the Ruby mysql module. I want to print out the results of a query and include the column names. I'm having trouble finding the method to give me an array of these names. I have the values as shown below. result = my.query("select * from foo") result.each do |row| puts row.join(',') end Thanks for the help! ...

Zend framework query, add to string

Hi guys, let's say that I have: $query = $this->select() ->where('name LIKE ?','%something%'); ->where('section LIKE ?','%something%'); ->where('cars LIKE ?','%something%'); ............ ............ You get the point! But I want to add the where() clause to the qu...

Program crashes if returned value is null

hi, i am trying to retrieve some data from mysql(c#,mono), the problem is that if the returned value is null the program crashes, i know it has to do something with the returned null value, because if i want to retrieve something that is in the database it works,can anyone help me with this? The code: MySqlConnection dbcon; dbcon = new...

image upload with sending content with form

hello! i got a form: <form name="form2" method="POST" action="post.php"> <p>ba$lik:&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="baslik" size="90"></p> <p>spot kisa: <textarea name="spot_kisa"></textarea></p> <p>spot uzun: <textarea name="spot"></textarea> </p> <p>kategori: <select name='kategori'> <? while ($kat=mysql_fetch_array...

Is it possible for SQL to find records with duplicates?

Can I use a SQL query to find records where one field is identical in both? That is, can I use the following table and return 1,3 (the ids) by comparing the name columns (and ignoring the phone)? ID | Name | Phone 1 | Bob | 5555555555 2 | John | 1234567890 3 | Bob | 1515151515 4 | Tim | 5555555555 ...

Upload picture to server successful but insert file name to database is blank

Hi everyone. I appreciate your effort tat helping newbies like me. I have the following problems and will appreciate urgent help. PROBLEM NUMBER 1: Using PHP and MySQL, I am able to upload picture successfully unto the server but not so with the file name of the picture even though other parameters in my form got inserted successfuly i...

Please Help Me With Mysql Slow Query Analysis.

I have this mysql query that I am trying to analyze. It is very slow, the visitor table here is about 50K entries, this query never returns. When I tried an explain statement, I found out that the index is not being used on the visitor table, In spite of the index being available. Now this is the great puzzle I need help solving. Any hin...

Characters to use for \r\n when inserting into SQL Server

I'm attempting to insert some data from MySQL to SQL Server. I've dumped the MySQL table to a text file as SQL insert statements. I can insert it into SQL Server ok but the carriage returns are inserting as \r\n rather than as control sequences. How can I replace the \r\n strings in the MySQL insert statements so that they will end up as...

mysql_num_row() error

This is the error that I am getting while using mysql_num_rows() function Error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource Here is my source code: $title = "SELECT * FROM item WHERE item.title LIKE % " .implode("% OR item.title LIKE % ", $data); $title_result = mysql_query($title, $this->dbh);...

mysql ADDDATE issue updating record

I have the following sql statement: start_time = ADDDATE(start_time, INTERVAL $minuteDelta MINUTE), end_time = ADDDATE(end_time, INTERVAL $minuteDelta MINUTE) start_time and end_time are both time fields in my database (not datetime) $minuteDelta is 60 for argument's sake Right now it doesn't throw an error but resets my time fie...

mysqli isn't returning the affected rows.

Can someone tell me what I'm doing wrong? I cannot get the affected rows returned after a row has been deleted. The function always returns int(0) even though the delete action was preformed. I read where I needed to clear or close the results which I have done but it still does not work. A debug shows this error: Command out of sync. Th...

Getting the latest entries for grouped by the foreign key in MySQL

Hi! I got the table with the fields: id, foreign_key, created, modified It's a table that logs the changes of a part of my program. What I want is to retrieve the latest logs grouped by the foreign key. How do I do this? EDIT: to summarize, how do I order first before I group? ...

How do I edit form and script to upload two files instead of one -file to server, file name to mysql

The form and PHP code included here has been used to successfully upload a file name to the database and the file itself to a folder on the server. I need to edit the form and the code to allow for simultaneous upload of two files instead of just one. The filenames will go to the database while the files themselves will go to a folder ...

JQuery autocomplete result

Hello I am using autocomplete to allow users to search venues stored in a MySQL database. The autocomplete plugin is currently listing the venues when the user begins typing and prints the selected venue using the result handler. I would like to also print the address, phone number and website of the venue as well but I am not sure how ...

Problem regarding c#.net application communication with MySql

I am Developing a Desktop Application with c# .net and MySql as Database. It's an encryption application which produces an exe file which communicates with MySql to bring some data. I am using the MySql.Data.dll for application communication with MySql. When it produces exe there is no MySql.data.dll with it so it throws an error: Coul...

Strange MySQL GROUP BY/ORDER BY behaviour

SELECT p.price, h.name AS hotel_name FROM prices p LEFT JOIN hotels h ON p.hotel_id = h.id WHERE p.city = 'boedapest' AND p.hotel_id IS NOT NULL GROUP BY p.name ORDER BY p.price ASC RESULT: 26 Eben Hotel Budapest 27 Ve...

Advantage of using Views in mysql

I've learned that views can be used to create custom "table views" (so to say) that aggregate related data from multiple tables. My question is: what are the advantages of views? Specifically, lets say I have two tables: event | eid, typeid, name eventtype | typeid, max_team_members Now I create a view: eventdetails | event.eid, eve...