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
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
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:
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 in
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
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
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
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
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
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 Consultancy
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
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
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 should
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
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
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
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.
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
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
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
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 suggestion
Hey HEY! Another old Fox-Jockey! :) (Th
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
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
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.
25 matches
Mail list logo