mysql

How can I sort one table by a column in another in MySQL?

Say I have a table named items: id int(11) ... tag int(11) And another table named tags: id int(11) name varchar(255) The tag column in items is an index into the tags table. How can I select some rows from the items table and sort the results by the name column in tags? ...

Zend: Fetching row from session db table after generating session id

Hi, I'm trying to update the session table used by Zend_Session_SaveHandler_DbTable directly after authenticating the user and writing the session to the DB. But I can neither update nor fetch the newly inserted row, even though the session id I use to check (Zend_Session::getId()) is valid and the row is indeed inserted into the table....

querying mysql and loading result into a list in a pythoncard gui

so heres whats up. I'm making a little program for myself that 1)takes a name of a row from a drop down box and makes a query with it and 2) displays query results into a multi-column list. i have the gui setup i need to sript the drop box with the query names and then have the results go into the list i set up in the gui heres the code...

Need MySQL RLIKE expression to exclude certain strings ending in particular characters...

So I've been working with RLIKE to pull some data in a new application and mostly enjoying it. To date I've been using RLIKE queries to return 3 types of results (files, directories and everything). The queries (and example results) follow: **All**: SELECT * FROM public WHERE obj_owner_id='test' AND obj_namespace RLIKE '^user/test/p...

useing my own db $info to replace parts of a url and open in a iframe

this dont work any options please? "Result below if printed" http://maps.google.com/maps/api/staticmap?center=WYOMING,WYOMING,MI&zoom=14&size=500x500&maptype=roadmap&markers=color:blue|label:S|42.902160,-85.696708&sensor=false need to replace parts of url like shown above to enter "result" into an iframe src= ???...

SQL Query Not Functioning - No Error Message

ORIGINAL TEXT REMOVED OK, so I found the original problem thanks to a helpful answer. It lists "Invalid query: No database selected" as the error. require_once ('../dir_connect.php'); $dbc = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); if (!$dbc) { die('Could not connect: ' . mysql_error()...

A better way to build this MySQL statement with subselects

I have five tables in my database. Members, items, comments, votes and countries. I want to get 10 items. I want to get the count of comments and votes for each item. I also want the member that submitted each item, and the country they are from. After posting here and elsewhere, I started using subselects to get the counts, but this q...

will a mysql query run slower if one of the tables involved has no index defined?

There's this already populated database which came from another dev. I'm not sure what went on in that dev's mind when he created the tables, but on one of our scripts there is this query involving 4 tables and it runs super slow. SELECT a.col_1, a.col_2, a.col_3, a.col_4, a.col_5, a.col_6, a.col_7 FROM a, b, c, ...

How to Create MySQL Query to Find Related Posts from Multiple Tables?

This is a complicated situation (for me) that I'm hopeful someone on here can help me with. I've done plenty of searching for a solution and have not been able to locate one. This is essentially my situation... (I've trimmed it down because if someone can help me to create this query I can take it from there.) TABLE articles (article...

"Failed to find or load the registered .Net Framework Data Provider" with MySQL + ASP.NET

How do we repair this? This question has been sort of addressed many times around the internet, but it's always a workaround. Always copying the MySql.data.dll into your bin directory, or explicitly stating what version you want. What is the "proper" approach to using DbProvderFactory for MySQL with ASP.NET? I'd like to be able to de...

mysql database that can be accessed over a vpn?

I have 2 computers. Both with w7 as os. I have installed wampserver on one of them. I have mysql database on wampserver. Then I have made a vb.net program to connect to mysql database. I have put the program on both computers. What I want to do is for those two programs to see the same database that is on one computer. For them to be abl...

Connect two database from 2 different host

Hi, currently I have two websites: 1. A website connected to mySQL database in host A. 2. A website connected to Ms. Access database in Host B. Is there anyway if I update the database in Host B, the database in Host A can be updated automatically? Thank you. Really appreciate your help. ...

How to fill a drop down menu

I want to populate a drop down menu with a column from a MySQL database. I have the rest of my database set up, but at the moment it is just a text entry box and it would be easier just to select the actually entry from a list. Also does anyone know of a good tutorial or site that has tutorials and example codes for PHP and MySQL ...

MYSQL - Selecting a specific date range to get "current" popular screensavers.

Let's say I have a screensaver website. I want to display the CURRENT top 100 screensavers on the front page of the website. What I mean is, "RECENT" top 100 screensavers. What would be an example query to do this? My current one is: SELECT * FROM tbl_screensavers WHERE WEEK(tbl_screensavers.DateAdded) = WEEK('".date("Y-m-d H:i:s",str...

MySQL - Selecting how many "Days Old" a field is.

How can I select how many days old a field is based on it's "DateAdded" field? E.g.: SELECT DAYSOLD(tbl_stuff.DateAdded) as DaysOld FROM tbl_stuff ...

How to link a table to a field a in MySQL server

I have this data from a xml file: <?xml version="1.0" encoding="utf-8" ?> <words> <id>...</id> <word>...</word> <meaning>...</meaning> <translation> <ES>...</ES> <PT>...</PT> </translation> </words> This forms the table named "words", which has four fields ("id","word","meaning" and "translation"). ...

How to delete part of a MySQL database record?

I want to delete part of a record. For example, a column called "message" contains the following string: "Hi, My name is John" I want to delete just "John" from the above while retaining the "Hi, My name is" part in tact. How can this be done? ...

Indexing only one MySQL column value

I have a MySQL InnoDB table with a status column. The status can be 'done' or 'processing'. As the table grows, at most .1% of the status values will be 'processing,' whereas the other 99.9% of the values will be 'done.' This seems like a great candidate for an index due to the high selectivity for 'processing' (though not for 'done'). I...

Sql query executing perfectly in phpmyadmin but giving warning while running on page

i don't know whats wrong with this sql query. SELECT * FROM main WHERE key LIKE '%$word%' its giving results in phpMyAdmin but giving warning while executing it in a php page. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource ...

Getting column info from db with C#

In PHP I am able to retrieve information from a db like so: <?php $sql = "SELECT * FROM users"; $result = mysql_query($sql); $data = array(); while($row = mysql_fetch_assoc($result)) { $data[] = $row; } I am trying to acomplish the same thing in C#: OdbcCommand cmd = new OdbcCommand("SELECT * FROM use...