Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Server "date Created"


When I open MySQL Control Center, it shows "server properties" window
when the server is selected on the left pane.
One of the property is "date created". I have not found this variable in server
and status variables .... Does anyone know how to read this variable using
MySQL SQL query or MySQL API (not file system, etc. ) ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Server "date Created"
When I open MySQL Control Center, it shows "server properties" window
when the server is selected on the left pane.

One of the property is "date created". I have not found this variable in server
and status variables .... Does anyone know how to read this variable using
MySQL SQL query or MySQL API (not file system, etc. ) ?

Relations In "CASCADE", "SET NULL", "NO ACTION", "RESTRICT", "--" ?
what do they mean to set the relations of a Foreign KEY in "CASCADE", "SET NULL", "NO ACTION", "RESTRICT", "--" ?

REQ: MySQL 4.0 Equivilent Of "DateDiff("m", Date, Now())=1"
I have a query that works in the rest of the SQL world

"SELECT invoice.*, invoice.Date
FROM invoice
WHERE (DateDiff("m", Date, Now())=1);"

which will give me all of last month's invoices.

However it doesn't work with MySQL 4.0.

While

"SELECT
Invoice.*
FROM
invoice
WHERE
(Month(Invoice.Date) = ((Month(Now()))-1))"

Is a close substituent, it will blowup in January.

Anyone have an equivalent expression for MySQL 4.0?

Files "-bin.xxx" Created In Mysql/data Subdirectory
I'm using an old version of Mysql : 3.23.58
In this version (may be it is the same in the latest one) some files named :<machine>-bin.001 , 002, 003, ... are created some times to times in the mysql/data subdirectory.

Is somebody have some information about these files ?
What are they including ?
When are they created ?
Can I remove them ?

Single Query For No Of Hits &quot;Today&quot;, &quot;This Month&quot;, &quot;This Year&quot;
Is it possible to construct a single query that fetches the no of pageviews "today", "this month", "this year" and "total since start"?

The table is very simple, one field for Date (YYYY-MM-DD) and one for the no of pageviews this day.

If not, would it be much slower/faster to divide the query into 4 different queries?

Adding A &quot;date Added/date Modified&quot; Column?
I want to have a column in my table that is automatically populated with the current date/time when record is inserted? Hopefully there is an easy way to do this that I don't know about.

Encountering 2013 Error ("Lost Connection To MySQL Server...")
I have a nightly job that performs backups on my MySQL servers. There are three production MySQL instances on different machines. My backups have been running successfully for months (until now).

However, on last night's backups for one instance, a couple of database/schemas (appear to have) backed up successfully, but the larger schemas failed, as follows:

=======================================
Backup of schema dhunt was successful in 0 seconds
Backup of schema mysql was successful in 0 seconds
Backup of schema support_appl was successful in 0 seconds
Error: Backup of schema support_dict was not successful (1115 seconds):
mysqldump: Got error: 2013: Lost connection to MySQL server during query when retrieving data from server
Error: Backup of schema test was not successful (0 seconds):
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
=======================================

I re-ran the backup cron job with the same results. Does anyone have any troubleshooting suggestions?

Unable To Connect To Server (was "Novice User Problem")
I've been reading Kevin Yank's Build Your Own Database Driven Website and am unable to connect to the MySQL server as he describes in Chapter 4 (p. 74-75).

After modifying his code to produce a mysql_error, I get:

Unable to connect to server at this time.Client does not support authentication protocol requested by server; consider upgrading MySQL client

Even though I am using the latest MySQL server (5.0).
My
?php

$dbcnx = @mysql_connect('localhost', 'root', 'my_actual_password');
if (!$dbcnx) {
exit('<p>Unable to connect to server at this time.' . mysql_error() . '</p>');
}

if (!@mysql_select_db('ijdb')) {
exit('<p>Unable to locate the joke database at this time.</p>');
}

?>
<p>Here are all the jokes in our MySQL database:</P.
<blockquote>
<?php
$result = @mysql_query('SELECT joketext FROM joke');
if (!$result) {
exit('<p>Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($result)) {
echo '<p>' . $row['joketext'] . '</p>'
}
?>

How Can I "see" A Table In A Database On A Remote MySQL Server After Creating It
I used the following SQL to create a new table in a database on
a remote MySQL server by copying one already there. I know the
table exists SOMEWHERE in cyberspace. I can read its data, write
to it, delete from it. But I cannot see it. The only way I know it
exists is by running this SQL from Access 97 pass through query:

SELECT ALL new_tbl.name FROM new_tbl

The database resides on a MySQL server that was created with
a single table (named test) in it for testing purposes. I ran the
following SQL to create another copy of the table in the same
database named: new_tbl

CREATE TABLE new_tbl SELECT * FROM test;

I cannot see the new table in the Access 97 database window
under the Tables Tab. Anybody know how to overcome this?

Its a severe drawback to programming efforts not to KNOW what
tables are in your database.

First And Last Time In Each Date By Empl (was "Help Me With This Select Statement")
I have the following table which has the following fields:

logid, empid, transdate,transtime

I want to select the first and last transtime in a specific date for every employee, how can i do that?

"Lost Connection To MySQL Server During Query"
Bog standard SuSE 8.2 Linux install.

I have installed mySQL (off the SuSE 8.2 distro CDs). I can connect locally,
e.g:

bealzebub> mysql -u root -p mysql -h localhost

....logs me in just fine. However, this:

bealzebub> mysql -u root -p mysql -h bealzebub

....causes the connection to fail with: "ERROR 2013: Lost connection to MySQL
server during query". Its the same if I try to log in from another machine.

"Lost Connection To MySQL Server During Query"
Hi, I wonder if anyone can help me with this.

Bog standard SuSE 8.2 Linux install.

I have installed mySQL (off the SuSE 8.2 distro CDs). I can connect locally,
e.g:

bealzebub> mysql -u root -p mysql -h localhost

....logs me in just fine. However, this:

bealzebub> mysql -u root -p mysql -h bealzebub

....causes the connection to fail with: "ERROR 2013: Lost connection to MySQL
server during query". Its the same if I try to log in from another machine.

Anyone?

Error &quot;cannot Connect Server On Local Host&quot;.
i cannot connect to MySql database at my server.F.Y.I i install MySQL 5.0 in my server 2003.when i try to connect from other pc its show error "cannot connect server on local host".how can i solve it.

&quot;Host Not Allowed To Connect To This MySQL Server&quot;
I just recently installed Fedora Core 4 and was just messing around with the MySQL server, I tried using mysql-administrator to connect to the server and i get this strange error "#HY000Host '192.168.1.104' is not allowed to connect to this MySQL server", I saw mysqlaccess and tried granting myself access to this server but i still get the same error while trying to connect!? Any thoughts?

&quot;external&quot; MySQL Server MsAccess Connection
I do have rented server space (webhosting) with 3 MySQL databases and a standard URL (e.g. www.1234567.ch).

Is it possible to connect to this "external" server with MsAccess?
If yes how?

How Do I Change The Tables Date Format Into "M/D/Y" ?
i have created a table with "date" as one of the field. i have noticed that "Y/M/D" is the default format for date fields.

how do i change the tables date format into "M/D/Y"?

Warning 1292 "Incorrect Date Value:"
I have been trying to find information about this issue in the
documentation and have not been able to.

I built a web-based app (PHP) that allows users to upload the contents
of a CSV file into database tables.

My users have reported that most of the time, everything is fine, but
some records do not show up. Although I can see the records by doing
a SELECT with the mysql interface, I cannot delete these records in
question. When I try to delete them 0 rows are affected and I get
this warning:

+---------+------
+----------------------------------------------------------------+
| Level | Code |
Message |
+---------+------
+----------------------------------------------------------------+
| Warning | 1292 | Incorrect date value: '1987' for column
'Sample_Date' at row 1 |
+---------+------
+----------------------------------------------------------------+

I haven't been able to find out what this warning means. I don't know
how to proceed here.

I Get "Can't Connect To MySQL Server 'name' 10061" (sometimes)
We have a system that runs php5 and MySql 4.1. The apache and mysql servers are on the same in-house network but on different boxes.

If a number of users invoke a page which has multiple queries that access a DB table of about 1 million rows of about 40 times, then the user gets "Can't connect to MySQL server 'name' 10061. This happen very irregularly.

The server chokes and a few seconds later comes back to life. I searched for this and got a lot of hits where users don’t have a connection at all. This is not the case.

- We have a SonicWall firewall, could the firewall think that it’s an attack on a port, when that many connections are coming?
- I also checked dev.mysql.com and got a lot of info on 10061, but it’s only those users who can't connect at all.

Intermittent "Can't Connect To MySQL Server"
Recently, I started getting small periods of intermittent connection errors about once every hour, lasting for about 1 to 5 minutes each time:
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock'

I enabled the error log and did some other monitoring and established 2 things:
- the server doesn't crash/restart, it keeps running throughout the errors
- the errors do not match the load on the website, as sometimes when 500 users are online there are no errors, but when 300 are online they may by prolific

I checked many forums and then made 5 changes:
- changed the directory containing the mysql.sock file so only file owners or superusers can delete files from it
- I changed the default socket file setting in both my.cnf and php.ini
- I read about SELinux causing such a problem, so I disabled SELinux completely, rebooted the server and double-checked that it is indeed disabled.
- I changed the maximum amount of open files allowed by the operating system from 1024 to 30000.

Despite all these changes, I still get the errors. I then read that there is a workaround by using TCP/IP instead of the sock file. I tried that, but I still get the error intermittently in the form of:
Can't connect to MySQL server on 127.0.0.1

This is a extremely frustrating problem, it's been bugging us for weeks, anyone who can offer some help - it will be greatly appreciated!

MySQL server 4.1.20, PHP 4.3.9, client API 4.1.20, CentOS 4.3, Intel P4 2.8GHz 1GB RAM

Intermittent &quot;Can't Connect To MySQL Server&quot;
Recently, I started getting small periods of intermittent connection errors about once every hour, lasting for about 1 to 5 minutes each time:
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock'

I enabled the error log and did some other monitoring and established 2 things:
- the server doesn't crash/restart, it keeps running throughout the errors
- the errors do not match the load on the website, as sometimes when 500 users are online there are no errors, but when 300 are online they may by prolific

I checked many forums and then made 4 changes:
- changed the directory containing the mysql.sock file so only file owners or superusers can delete files from it
- I changed the default socket file setting in both my.cnf and php.ini
- I read about SELinux causing such a problem, so I disabled SELinux completely, rebooted the server and double-checked that it is indeed disabled.

Despite all these changes, I still get the errors. I then read that there is a workaround by using TCP/IP instead of the sock file. I tried that, but I still get the error intermittently in the form of:
Can't connect to MySQL server on 127.0.0.1

MySQL server 4.1.20, PHP 4.3.9, client API 4.1.20, CentOS 4.3, Intel P4 2.8GHz 1GB RAM

Connect To &quot;mysql&quot; In Hosting Server?
i wana to connect to "mysql" in hosting server(on the web) from my descktop application how can i do this.

"dumping" Database From My Comp To Server?
i have been developing a site and building the DB on my comp at home. i do not have inet access and choose not to for security reasons. am i able to utilize the dump feature (new to this) still?

would i be able to save (burn) the info to a disk and then use that to perform the DB transfer to the new server? or what would be the workaround, if any...

Searching For Numbers - &quot;close To&quot; Or &quot;approximate&quot;
I would like to know how to search a table for records where a particular field is "close to" a particular number.

For instance, let's say I have a table containing students and their most recent test scores. I'd like to see students who scored 7/10. That's easy enough (select * from table where score = 7). I'd also like to run another query to identify other students whose scores are not 7 but "close to" 7. Ie students who scored 6 or 8.

As an added bonus, I'd like to be able to do a related search that shows students who scored 7, then shows the other students ordered by how "close" they are to 7. Ie students who scored 6 or 8 are "closest" matches, and students who scored 1 are "furthest". I hope this makes sense!

Is there any pre-existing MySQL command that will do this? Or will I have to run separate queries for each value?

NOW() Or Date(&quot;Ymd&quot;) To A Table Column
I recently started using MySql for my clients Web Pages. (Newbie) I’ve tried every trick possible to insert the DATE automatically without the user having to enter the date they fill the form. I have used Java, PHP and SQL instructions to fill the table column and nothing happens. Maybe is something with the DATE format column? All other table columns get the information is entered by the person filing the form. Is there something I’m doing wrong?

I have verifies that the DATE variable info is collected through PHP and Java, but the instruction to INSERT INTO does not takes the DATE info into the column.The field stills empty.

Equivalent To MS SQL &quot;Linked Server&quot;
Is there an equivalent to "Linked Servers" on the SQL Server platform?

If so, I'll continue my exploration into MySQL... I've installed servers on Linux and Windows and have yet to come up with a GREAT GUI management tool but I'm sure it's out there (any suggestions?) Anyway, my question is...

"Is there an equivalent to "Linked Servers" in MySQL?"

I need to access other DB's as though they were local and have a central spot for development.

MySQL "Server Types"
I have created a MySQL table in one of my domains control panel (borderprints.co.uk)

All the .php files are in the other domain (dryburghfalconry.co.uk) as this domain does not have the MySQL option.

So... in this line in my config.php:

$server = "localhost"; .........

........what should i have to access the table in the borderprints.co.uk domain from the dryburghfalconry.co.uk domain....? if possible...?

Value &quot;000&quot; Stored As &quot;0&quot; In Text Field?
I've managed to import my data from a CSV using SQLyog Enterprise, however, I have a problem with the table storing the text value "000", MySQL truncates it to "0", unfortunately, I need the value to be stored as "000", does anyone know of any way that I can force the field to store all the characters, rather than treating it as a number? Surely a text field should treat any numbers stored within it as text?

Return A &quot;true&quot; Or &quot;false&quot;
i wanna do a "select", where if the script finds any matches, i dont wanna know about them. Instead, i just want it to return a a value: true (1) ou false (0).

ie.:

$sth = $dbh->prepare("SELECT * FROM maps WHERE name='algo' LIMIT 1");
$sth->execute();

if (match is true) {
print "True Match. A match was found";
}
else {
print "False Match. No matches were found.";
}

"Group By" Forgets "Order By"
I'm trying to build a simple RSS reader for a client and am running into some serious problems with the GROUP BY in MySQL. Basically I have two tables: one that holds all the entries and one that holds all the feeds. Then what I can do is say:
[MYSQL]SELECT * FROM entries WHERE feed_id='13' ORDER BY date DESC[/MYSQL]
That will select all the entries that belong to feed #13. This is fine, but what I'm doing now is building a library that will display the feed_id with the latest entry with that id. So I would think it would be something like the following:
[MYSQL]SELECT * FROM entries GROUP BY feed_id ORDER BY date DESC[/MYSQL]
That should get me the single latest entry from each feed_id. However it's forgetting the ORDER BY clause all together and seemingly ordering it by the auto-incrememnt value in the entries field.

Server Not &quot;seeing&quot; MySQL
This seems to be a constant problem and a great frustration for newbies looking for alternatives to MS solutions. I had PHP, Apache, and MySQL installed and working on my Windows 2000 machine but now have a new machine with XP. PHP and Apache are working but its as though MySql wasn't even there.

When I run phpinfo() to troubleshoot, there isn't even any reference to MySQL in all the data I get back. Been following the threads on this forum and it looks like everything else is right; my.ini in the right place; libraries in the right place; - who's got the magic bullet?

"table Is Read Only" After Copying Table Files To New Server
I'm trying to port my MySQL tables for a database called "tracerlock" from
one server to another. On the old server, in the /var/lib/mysql/tracerlock
directory, there was a ".MYD", ".MYI" and ".frm" file for every table in
the database. So after creating a database called "tracerlock" on the new
server, I copied these files over to the /var/lib/mysql/tracerlock
directory on the new server. On both servers, all the table files are
owned by user "mysql" in the "mysql" group.

Now, when I connect to MySQL on the new machine and load the tracerlock
database, "show tables" shows all the tables as expected, and I can perform
SELECT statements on them and get the correct results. But when I try
doing INSERT statements on one of the tables that was copied over, I get:

mysql> INSERT INTO test VALUES(3);
ERROR 1036: Table 'test' is read only

However, if I create a new table called test2, I can perform INSERT
statements on it with no error:

mysql> insert into test2 values(3);
Query OK, 1 row affected (0.00 sec)

Code:

"table Is Read Only" After Copying Table Files To New Server
I'm trying to port my MySQL tables for a database called "tracerlock" from
one server to another. On the old server, in the /var/lib/mysql/tracerlock
directory, there was a ".MYD", ".MYI" and ".frm" file for every table in
the database. So after creating a database called "tracerlock" on the new
server, I copied these files over to the /var/lib/mysql/tracerlock
directory on the new server. On both servers, all the table files are
owned by user "mysql" in the "mysql" group.

Now, when I connect to MySQL on the new machine and load the tracerlock
database, "show tables" shows all the tables as expected, and I can perform
SELECT statements on them and get the correct results. But when I try
doing INSERT statements on one of the tables that was copied over, I get:

mysql> INSERT INTO test VALUES(3);
ERROR 1036: Table 'test' is read only

However, if I create a new table called test2, I can perform INSERT
statements on it with no error: Code:

REGEXP To Find "foo-bar" And "foo Bar"
Does somebody know how to solve this:

select * form geo,places where  geo.name = places.name

Where geo.name could be New York
and geo.places could be New-York

"Select * FROM" Vs "Select Field1,field2 FROM"
No matter how many fields I want to retrieve from the table I always use "Select * FROM Table" instead of "Select field1,field2 FROM Table".

Are there any disadvantages of always using "Select * FROM Table"?

Select &quot;german, French&quot; Only With &quot;german&quot;
in a table I have this entry in the column "language":

"GERMAN, FRENCH"

how do i have to make/modify my mysql-syntax so that i can select the entry abowe only with the word: "GERMAN"? Is this possible or do i have to make a data manipulation first?

&quot;Calculated Fields&quot; In &quot;
o I want to create a table "totals" with three following fields:
Field 1 => quantity
Field 2 => unit_price
Field 3 => quantity*unit_price

o I thought I could do something like:

=CODE=============================
CREATE TABLE totals
(
quantity INT,
unit_price DOUBLE,
total DOUBLE AS quantity*unit_price
);
==================================

o It fails with the following error:

=REPORT===========================
ERROR 1064 (42000):
You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version for the right
syntax to use near 'AS quantity*unit_price)'
==================================

Question1: Is it possible to declare "calculated fields" at "table creation" ?
Question2: If yes, how to do so?

Maximum Execution Time Of 300 Seconds Exceeded (was "MYSQL Error")
I have a huge database 400mb+ in size which i have exported into a .sql file. I tried to run this export script into a new database and it runs fine until three quarters into the scripts execution and the following error appears:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<br / >
<b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b' at li ne 1
I believe this error may relate to "delayed_insert_timeout = 300". How do I increase this limit in mysql - maybe it may solve the problem but then again it may not .

Any advice is most gratefully appreciated - As you can imagine if the script runs fine for 3/4 of it and then an error appears, stating the error is on line 1, it will take me days to go through the whole script (hundreds of thousands of rows) to find the error as I assume the error does not reside on line 1 as this line would have been executed.

I am running the script on mysql 5, and via source /path/****.sql on linux.

Error "Can't Find FULLTEXT Index Matching The Column List"
I'm trying to use fulltext search with mysql match() against() but i keep getting this error
Can't find FULLTEXT index matching the column list

even though i already altered the table to make the column im searching FULLTEXT

any ideas?

Design For Stock Items And Checkin/checkout Process (was "Query Help")
I'm currently in the process of trying to bodge together a simple(ish) stock system to be used on a company intranet but I've ground to a halt with a particular problem.

Using a MySQL database I've got tables with 11 fields, including 'Quantity' (self explanatory) and BookOut. Now this BookOut field contains information on the user who has booked out an item including the users name, the date/time etc

The problem I have is this. If an item has a quantity of 7 and a user books out 1, then his/her info is stored in BookOut but when another user books out another 1 of said item at a later stage then the previous BookOut info is overwritten.

Is there a way in that everytime another item is booked out that a new line is created within a specific field?

}

if(!sizeof($error)){

$update_SQL = "Update joystick Set BookOut = '" . mysql_real_escape_string($BookOut) . "', PCserial = '" . mysql_real_escape_string($PCserial) . "', Quantity = Quantity - " . $Quantity . ", MachineNo = '" . mysql_real_escape_string($MachineNo) . "', Date = now() WHERE ID = " . $ID;
if(! @mysql_query($update_SQL)){

$error[] = "Update SQL failed";

}
The above is the query I am currently using. I'm not totally proficient with .php and have already had a lot of help getting this far.

Query To Populate A Calendar (was "Wanted The Experts Opinions (that Means YOU!)")
I am building my first calendar for a client to list All their events on a month to month basis.

There are several tables of data that I need to query to populat the calendar from: Events, Committee Meetings, Lectures, and Group Actions.

I was wondering:

#1) Is it more effecient to query all the tables once and to store the results into an array that I can check as I loop through and output the days for the calendar?

#2) OR, is it better to query all the tables for each day as I loop through and construct the calendar ouput?

After formulating my question it seems like a no-brainer: That option #1 would be the most effecient, but I still would like to know your opinions. Especially if you have made a calendar before.

Searching A Comma Separated List Of Numbers (was "Brain Toot")
I'm at burnout point and simply cannot remember how to do this in a MySQL query.

I have as an input from a form:

&#391;,4,6,8,55,74,11123'

Basically a comma separated list of numbers

The table I'm accessing has multiple records with a column called 'areas' this column for each may contain some of multiple of these input form numbers. e.g.

row 1 &#393;,1,76,77,89,400'
row 2 &#391;,2,7,8,55'
row 3 &#391;,4,6,8,55,74,11123'

I need to return any row that has at least 1 matching value from the form input list.

I literally staring at the screen after a marathon coding stretch and cannot get the mind in gear.

Store Web Site Club Registration Data (was "MySQL Question")
I am working on a website for a club. One thing that they want included in the site is a way for people to register online for the club and their services and for this information to be put into a database for the owners to view. Is this something that I can do with MySQL?

Batch Mode Feedback Of &quot;mysql&quot; Command Line Tool
while writing a bash shell script to backup some databases and I am having slight problems with the mysql command line tool's feedback.

Here goes command line:

#!/usr/bin/env bash
mysql -ubackup -e "UPDATE `mydb`.`sysvar` SET `val`='backup' WHERE `var`='updateState' AND `val`='0';"

The backspaces are nescessary for the shell, otherwise it'd interpret whatever is inclosed in --> ` <--- as command.

The problem is, I need to know wether a line has changed or not. The command always returns 0 (that is a success in Unix/Linux) if it was successfully executed, no matter wether or not a line had been changed, and produces no output at all.

Could anyone tell me how I get that info?

Full Text Search - Un-stopping Default Stop Word &quot;first&quot;
using a full text query with the word "first" does not return any rows. I would like to remove the word "first" from the default stop word list ?

Generating DAILY Min&amp;Max Over A Period Of Time, Based On A &quot;DateTime&quot; Field
how to print the minimum and maximum of a specific field, between two datetimes (both having the time 02:00:00) - so I did this:

WHERE ((tblvalues.dtLPDateTime)>="2006-01-01 02:00:00" And (tblvalues.dtLPDateTime)<"2006-01-03 02:00:00"))

Now I want to print those min and max values but for each day in this cycle, i mean, for this example, there would be two records like:
Day Min Max
2006-01-01 02:00:00 -> 2006-01-02 02:00:00 | 40 | 59
2006-01-02 02:00:00 -> 2006-01-03 02:00:00 | 49 | 68
where at this point i`m getting min=40 and max=68

"supplied Argument Is Not A Valid MySQL Result Resource" Error
i am getting this error with the following code:

$query = "SELECT title, firstname, surname, address1, address2, address3, postcode,"
."tel, mobile, email"
."FROM user"
."WHERE username='$valid_user'";

us.skill_id=s.skill_id"

$result=mysql_query($query);
$num_rows=mysql_num_rows($result);
$row=mysql_fetch_array($result);

The error is referring ot the last 2 lines of this script.

Linking Stores With Products (was "MySQL Dificult Code")
I have a MySQL database dificult (for me anyway..).
I have a ecommerce site with a table of products.
Now I want to create a new table with a list of stores where clients can find near home those products. In a limit situation I can have a list of all products indexed in one store (and the products list is increasing everyday, the same with the list of store...). I want this feature to be capable of introdution of new products in a store that already as several products.
My idea is to develop 3 tables:

Products
+----+-----------+--------------+
| id | name | description |
+----+-----------+--------------+
| 1 | xxxxx | aasa... |
| 2 | vvvvvv | asasasasas... |
+----+-----------+--------------+


Stores
+----+-------------------+-----------+
| id | store | address |
+----+-------------------+----------+
| 1 | aaaaa | street1... |
| 2 | bbbbbb | street2... |
+----+-------------------+-----------+



Linking stores with products
+----+-------------------+-------------+
| id | store id | products id |
+----+-------------------+-------------+
| 1 | 1 | 1;2 |
| 2 | 2 | 2 |
+----+-------------------+-------------+

Can I implement this in MySQL? I mean how can (if I can) place several ids in a field? and how can I do the query in order to list the products inside a store?
Hope that I made my self clear. If not please do not hesitate to request further information.




What Is Execution Time Of A Query Based On? (was "a Mysql Question")
when selecting data from the database, does the time taken to retrieve it vary from 56k connections to T3 connections? or does it all depends ont he general server speed/amount of connections on the db?

im not sure if ive explained that in the best way for people to understand
but im sure someone will get what i mean


Copyright © 2005-08 www.BigResource.com, All rights reserved