Help with database Design

2002-12-22 Thread Ricardo Fitzgerald
Hi,

I'm having problems trying to figure which is the best way to solve a design
:

I'm designing a delivery program with php and mysql, and I'm having troubles
with some tables,
my problem is with the recipes, the recipes are divided into two tables one
with a recipe id and description the other detailing the ingredients, of
each particular recipe, that's where my problem starts because each
ingredient is not unique and even it appears in many recipes, and another
thing is every time and item is ordered their correspondent
recipe ingredients are added , ie. pizza has a code 11, recipe has code 01
then all the ingredients in the recipe table
have different ingredient code each, and are related by the recipe code 01,
then each separate item must be counted,
and added to the ingredients general daily totals, I mean pizza uses 2
tomatoes then the general total will show two tomatoes and each other
ingredient. There are also some combined recipes : Pizza with a special
sauce, then this item has to query two parts of the same table, say code 12
is Pizza with a combined sauce of mushrooms and milk, and pineapples, so
each ingredient must be added to the general total. I need help with the
design because I don't want to have database anomalies.

Thank you all,

Merry Xmas
Rick


__ Omni
ICQ#: 37031810 Current ICQ status: + More ways to contact me
__


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Permissions -- After grant all on *.* to admin@localhost --- I got access denied

2002-06-12 Thread Ricardo Fitzgerald

Hi,

I added a table to my phpnuke database, all connections to this db
work perfectly, except this custom table, it gets data from a form.
Before I was using it just to show data was succesfully retrieved, and
it was working now I added these lines:

?
$db = mysql_pconnect(localhost, admin, 123456);
 
if (!$db)
{
 
echo Error : Can't Connect !. Try Later.;
exit;
// After these line mysql exits with error Access Denied . If I check
// admin@localhost with phpMyAdmin it has all permissions granted.
// What's wrong ??  

}
$date = date(U);
mysql_select_db(ermitage);
$query = insert into nuke_ermitage values
('.$Nombre.', '.$Apellido.',  '.$Direccion.', '.$Ciudad.', 
'.$Telefono.', '.$Mail.
', '.$Pais.','.$date.');
echo $query;

.
.
.
more stuff ...
?

TIA,
Rick

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Syntax dilemma

2002-06-02 Thread Ricardo Fitzgerald

Hi,

I'm having trouble trying to insert form data into a mysql db, the
thing is my client wants table data to be splitted, I mean some data 
comes from the first form, and the rest from another form.
This is a portion of the php script.

// Add together proper fields to enter birth date
$fecha_nac = $ano_nac  + - + $mes_nac + - + $dia_nac;

// Open mysql db
mysql_select_db(intertur);

// SQL query insert all data into a table
$query = insert into RegistroPersonas values
('.NULL.','.$nombre.', '.$apellido.', '.NULL.', 
'.$direccion.', 
'.$ciudad.', '.NULL.',   '.NULL.', '.$pais.', '.$telefono.', 
'.$fax.', '.$email.', '.$login_usuario.', '.$clave.', 
'.$fecha_nac.',  '.NULL.',  '.NULL.' '.$sexo.',  '.NULL.',  
'.NULL.', '.NULL.', '.NULL.' );
 My problem is NOTHING gets inserted !!! 
 I filled all empty fields with NULL values
 It connects to the db but does nothing else
// Do query  
$result = mysql_query($query);

// this script has a form at the end, where the remaining fields are
// filled
// and calls the next script, where the tables are altered
// there and the empty fields filled with the values retrieved

I suppose to use Update in the next script , to enter remaining
data, but I'm not sure because the first field auto increments, 
and is the primary key. 


TIA

Rick
AXIS Computers

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Newbie question : Can't connect to database through a web interface

2002-05-31 Thread Ricardo Fitzgerald

Hi,

I'm developing a web application using mysqld as a localhost but
accessed from anywhere. My problem is simple, after entering form
data, and execute the php script, always returns an error I wrote in
case of unsuccesful connection to the db.

I did everything , create a user with many privileges, then flushed
the privileges, if I use PhpMyAdmin to access the db I have no
problems, the error happens when I use my program, what can be wrong

here are the lines I use to connect to the db and display error
message:

@ $db = mysql_pconnect(localhost, testdb, test123);
if (!$db)
{
 echo Error: could not connect to database. Please try again later.;
 exit;
}
mysql_db(mydb);
...

What can be wrong ?
I'm starting to learn both php and mysql and I still can't understand
why this happened.

Regards,
Rick

AmpaSA Engineering




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Newbie -- Error codes

2001-08-09 Thread Ricardo Fitzgerald

Hi,

I'm new to mysql. I've installed an RPM undr Linux PPC and after running mysql server 
as root and trying to use a sample database from Paul Dubois book MySql, I ' ve got 
the error 13, can't create directory/file ./samp_db/president.xxx.

The thing is I'm using an example DB, any help ? Where I can find out what the codes 
mean ?

Regards,

Rick



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php