syndicator

consecutive ids in a batch insert?

Hi list, I am new to mysql and would appreciate any advice that you have to offer. I am attempting to batch insert 100 rows into a table, and I need to know the 100 id's of all the inserted rows. I know that I can find the id of the last inserted row despite my app being multi-threaded, since the select last inserted command is

MySQL Performance Statistics

Could someone view the following that I copied from phpMyAdmin and tell me from the statistics if are server is running OK? Does it look like we will have problems as more people hit our server? I'm not a db admin, so any help would be grateful. Regards, Jim This MySQL server has been running for 3 days, 1 hours, 53 minutes and

fetching one field

let's say i have a table in my database, with only one column. all i want to do is retrieve a list of the entries.. i could do it like this $result = mysql_query("SELECT * FROM t1"); while( $x = mysql_fetch_row($result) ) { echo $x[0]; but it seems kinda silly to fetch an entire array, when only the first

Font error after restore database.

Hello I have a forum which is use Vietnamese language and input is utf-8. It work normall in mysql 4.0 but after i upgrade to mysql 4.1 it has some strange error in font. Some character like á à é broken and become ỿ . :( . In the end i found a stupid solutions, that was i copy a /usr/local/mysql/mysql/databas ename/ ( a folder which is contain

sort asc w/ most recent

hi, i want to display the five most recent rows in my table (there is a timestamp), but sorted in ascending order. the problem is that when i call SELECT * FROM spam ORDER BY time ASC LIMIT 5 it shows the first five entries in ascending order, but i want the last five. needless to say, it works fine with descending order..

Database design (need help with a schema)

I'm building a site for my family & friends to all keep in touch and the two features I'm coming to a halt about is this (in database design) I let users create their own pages (with a title and content) but there is pre-defined pages that every user has and SOME are user specific. For example, blog, calendar and comments are 3 normal pages everyone

join tables?

hi. i have two tables. table one ("users") contains two columns, "user_id", and "user_name" table two ("spam") contains three columns "msg_id","user_id", and "msg" basically, i want to retrieve all the "spam" entries, but instead of displaying the user_id, i want it to show the user_name, from table

background and partial solution of sql-myql mode of Emacs on WinNT

I collect the following messages from Usenet and make a summary. *Problem*: There is no buffer output or output prompt ( the line after output), when a mysql process is initiated in Emacs WinNT. *Partial solution*: (setq sql-mysql-options '("-C" "-t" "-f" "-n")) display the output, but still without output prompt.

problem with Subquery

hi, I've following table: +----+-------------+---------- +-------+-------+ +----+-------------+---------- +-------+-------+ +----+-------------+---------- +-------+-------+ I've products from diffrent delivers and I'd like to write the query which tell me for each product which price is lowest (and have some

how to escape mysql_connect() DNS caching?

Hello people, There is a problem is that mysql_connect() somehow caches last sessions IP and is not using the one which you put into host place. Has anyone made mysql_connect() from php to multiple SQL servers so that script tries to connect to resolved IPs until it finds one that works? I have set up DNS so that on request sql.example.com it returns two