Two ideas that come immediately to mind--
1) Is the web server on the same machine as MySQL?
2) Have you looked at replication? You could have n slaves/webservers that
display data, and all wrtes go back to the master. There's a rather
detailed analysis in the docs that explain how to figure o
I agree with the Paul DuBois book on MySQL. Another good one to get if you
are just getting started with databases and is somewhat system-agnostic is
"Database Design For Mere Mortals" by Michael Hernandez.
- Original Message -
From: "B. van Ouwerkerk" <[EMAIL PROTECTED]>
To: <[EMAIL PR
You can't. You'll have to regenerate a new, random password and send that
out.
- Original Message -
From: "Kevin Williams" <[EMAIL PROTECTED]>
To: "MySQL Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 27, 2001 7:27 AM
Subject: Password function
Peeps,
My problem is this. I'm
try
alter table fixtures change id id int auto_increment
Notice that the two references to "id" are intentional!
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 2:44 PM
Subject: using ALTER TABLE to make existing column AUTO_INCREMENT
You'll have to be more specific in your example -- your select statement
below is rather ambiguous.
However, take a look at the CASE WHEN...THEN functions that MySQL offers.
I'm sure it's exactly what you are looking for.
- Original Message -
From: "Bryan Coon" <[EMAIL PROTECTED]>
To: <
> MySQL doesn't support IN and NOT IN. The manual and mailing lists
describe
> alternatives for many cases, but these are less readable (and maybe
slower).
>
I know that this response was directly related to a question about
subqueries, but I think it's important to point this out, because I alm
What's the "LIMIT 0,30" for ?
Also, you should probably do this:
$insert_result = mysql_query($insert_query) or die(mysql_error());
Then you wouldn't need to wait for an answer ;-)
- Original Message -
From: "Ryan Shrout" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March
Leo,
There's another alternative that I found intriguing with MySQL that I
haven't tried - but it might be a really good solution for you. Mind you I
haven't tried this, but I found the idea somewhat fascinating.
Have you looked into the temporary table functionality of MySQL?
Suppose you have
> Hello, this is how I'm searching a database now...is there an easier way
> (PHP)? Anything that's short would be nice. This is just really long.
You can do something like this:
> $searchgenre = "'punk','hardcore', 'classical', 'acoustic'";
> $sql_text = "SELECT * FROM artists WHERE genre i
Well, there's a few things. First, I think you need to do a few things to
better normalize your data. You need a table to join a person with a job.
It would look like this:
create table peoplejob (people_id int not null, job_id not null)
Then remove the job column from people.
Then when you c
If I understand your question, you need two queries:
select count(*) as count, ip, value from log group by ip
select count(*) as count, ip, value from log group by ip,value
- Original Message -
From: "Peter Holm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 16, 2001
The ''having marked=-1' clause filters out records after the entire query is
completed. The where clause modifies which recorded get included in the
first place.
> for now it's rather ugly and inefficient, but one way you could do it
would
> be like this:
>
> select table1.*, ifnull(table2.colu
Subqueries like that won't work until version 4.0.
for now it's rather ugly and inefficient, but one way you could do it would
be like this:
select table1.*, ifnull(table2.column2,-1) as marked from table1 left join
table2 on table1.column1=table2.column2 having marked=-1
I've done something si
I seem to remember that Microsoft SQL Server has the concept of a "covered index" that
worked something like this:
Suppose you have a table with a product_category, and a price. You query alot on
product_category, so you create an index on it. You're expression might look like
this:
select
The answer you seek is clearly explained in the manual.
- Original Message -
From: "Gupta, Sanjeev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 12, 2001 3:34 PM
Subject: how to create stroed procedure in mysql
>
>
> Sanjeev Gupta
> Programmer Analyst
> Indus Consulta
I checked the known bugs in replication, and I've found a situation where it
definitely does not propogate changes. I'd just like to know if this is normal or
not.
Say you have two databases (call them data1 and data2) on your master server. Only
data1 is being replicated.
Within the mysq
Maybe I'm not understanding how replication is supposed to work, but I've found a
situation where it definitely does not log changes. I'd just like to know if this is
normal or not.
Say you have two databases (call them data1 and data2) on your master server. Only
data1 is being replicated
select distinct item from $table
It sounds like you might want to read up a little on normalization, however.
> I would like to modify the following statement
>
> select Item from $table
>
> in such a way that it checks what kinds different items are in the
database. Hence, only those values sh
I think you really need another couple tables, even though your just writing
a sample.
You probably need a table named 'election' and one named
'electionparticipants'
Your election table would contain things like the date of the election, the
total number of votes cast, etc.
The electionparticip
You'd probably be better off having rank and votes fields in the actual
album_detail table. Whether you choose to maintain the individual votes in
the album_ranks is another story. Let's say you rank an album from 1 to
10 - the rank would then be calculated like this:
$uservote = 8.5 // this is
I'm assuming you're using PHP... this example is rather simplistic; you can
create a whole routine for building a select statment. You could have a
checkbox on the form that allows for AND/OR comparison (the name on the form
would be 'operator' in this example):
$query = "select * from $database
Have you considered replication? There's a pretty good chapter in the MySQL
manual on how to objectively determine the benefit to a master/slave setup
with n slaves (it depends on how often writes happen to the database).
- Original Message -
From: "vinod panicker" <[EMAIL PROTECTED]>
To
Well, except that the value of an auto-increment field CAN be set to a
specific value (perhaps negative) an INSERT or UPDATE statement.
> If Autoincrement can only work with positive numbers, then any
> key that is auto_increment should automatically be made unsigned.
>
---
> On 28.02.2001 15:33:27 John Dean wrote:
>
> > Hi
> > Since the language of business here at MySQL is English it would be nice
if
> > all messages to the list are written in English. This way you would have
more
> > chance of receiving reply
>
> Yeah, that's just what I was saying :]
>
But I'm s
> I'm a new user and I bought a book PHP fast and easy web dev.
> I'm trying to sign in. The book instructs me to c:\mysql\bin
> then do mysqld --standalone I get a bad command error. What do I do?
Install MySQL.
-
Before posti
You need to select the table name, and frankly, perhaps read up a bit more
on SQL in general. You're second command is simply creating a string. For
example,
"select 'this is an arbitrary string'" will return similar results.
You need to be form your query like this
select * from chrishallgre
Your problem is that you shouldn't be using mysql_pconnect().That
comment is for persistent connections, which you really don't want. What is
likely happening is the php thread ends, aborting what MySQL thought would
be a persistent connection.
Try changing it to mysql_connect()
here's some
Seperate out your query string into a variable and do it like this:
$query = "select a,b,c,d from table sometable "
. " where something=somevalue and "
. " otherstuff = 'bbb' ";
if (!$results=mysql_query($query)) die (mysql_error());
- Original Message -
From: "WCBaker" <[EMAIL
Have you considered using the SET datatype? It would be perfect for your
situation.
- Original Message -
From: "Nino Skilj" <[EMAIL PROTECTED]>
To: "'Tbone'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2001 7:38 PM
Subject: RE: Table Design -- which is better?
>
Well, if you have other varchar fields in your table, then it probably
wouldn't have any impact on performance. But since BLOBS and TEXT are
considered varchar, the table no longer is a fixed width. It is my
understanding that MySQL can locate specific records faster (even with
indexes) in table
> I am the dba for a track and field results web site, when people look for
> results they are most likely going to want results from a more recent meet
> (rather than older meets).
>
> there is a table result and a table meet where a column in result is
> "meet_hnd." (there maybe hundreds of resu
> Also, specifying fields won't break things when people add fields to a
> table.
Yeah, but you already have the same problem with SELECT *.
Let me give another example. You have a table with 15 rows. One of those
rows is TEXT. You really do want everything except the text. Doesn't
anyone e
I just started using MySQL in the past month or so, and love it so far. I come from a
background that includes a lot of FoxPro (way back in the days of FoxBase for the
Macintosh). I also have had a bit of MS SQL Server experience, but more using it as a
back end for Visual Foxpro.
One of the
an Visual Basic, but that's an argument for
another list ;-).
- Original Message -
From: "Cal Evans" <[EMAIL PROTECTED]>
To: "Jason Landry" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 21, 2001 11:07 AM
Subject: RE: Future sugges
I have a concern regarding how an index is being used for a query. I've
included the query (minus the fields) and the EXPLAIN output below. I'm
curious why MySQL would indicate that it's using filesort for table 'd'
since it's type is 'const.' The documentation indicates this means that
only on
I'm going to be setting up a development machine using linux (I'm currently doing work
with Win2K). My intent is to make sure I can do MySQL and PHP on a linux machine.
As a newbie to linux, what would be the best distribution of linux for me to use? I
don't mind paying a few bucks for the CD
Actually, I didn't correctly type in the example. In the second example,
one field from the table forum is also included in the query.
Apparently there are problems with match() if MySQL uses can't do the entire
query without creating its own temporary tables. I've just rewritten it
like this:
I am trying to write a query using the fulltext and match and I've run into a problem.
I'm new to MySQL, so this question might have already been asked, but I just can't
seem to find it.
I'm using the fulltext capabilities to do a query. The query requires joins with four
different tables.
38 matches
Mail list logo