Re: [PHP-DB] MySQL

2003-08-01 Thread Jeff
K, that got my a bit further, now it shows half the page but stops at the
line:

$result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
records.");

With error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource
in C:\FoxServ\www\encana_db.php on line 40
Error retrieving records.

BTW, thank you everyone for your help.


"Mel Hodges" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Try this:
>
> $strSQL = "INSERT INTO gradients (kwo, lsd, date, well, field, uni,
license,
> formation) VALUES
> ('$kwo', '$lsd', '$date', '$well', '$field', '$uni', '$license',
'$formation')";
> $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
records.");
>
>
>
>
>
> Quoting Jeff <[EMAIL PROTECTED]>:
>
> > Yes I'm new at this - sorry for sounding like an idiot.  I'm a network
guy,
> > not a coder by any means - just learning.  (Company "project")
> >
> > > First of all, get rid of all those extraneous open and close (
> > > ?> >
> > Done - it isn't the editor, I put them there - a lot of diffrent
testing,
> > and havn't had a changce to clean it up yet.
> >
> >  >(or is this code cobbled from
> >  >other places?).
> >
> > No, that's plagerisum. :P  Doing this all form a book I purchased which
> > dosn't cover MySQL as much as I had hoped.  Thats what I get for buying
it
> > online. :P
> >
> > >Second, the line in question is not valid PHP code.
> >
> > I figured as much, and did as you said, but it's still returning an
error.
> >
> >  >It's SQL. Put it in quotes, assign it to a variable, and call it
> >  >through a mysql_query() function.
> >
> > Error:  Parse error: parse error, unexpected T_STRING in
> > C:\FoxServ\www\encana_db.php on line 36
> >
> > My new code:
> >   > $PHP_SELF = mysql_query(INSERT INTO gradients (kwo, lsd, date, well,
field,
> > uni, license, formation) VALUES ('$kwo', '$lsd', '$date', '$well',
'$field',
> > '$uni', '$license', '$formation') )
> > ?>
> >
> > > --- Jeff <[EMAIL PROTECTED]> wrote:
> > > > Sorry, I just realized that's an older copy of the code, here is
> > > > the updated stuff - (It's just one more line, the line that's
> > > > giving me greaf. :P  )
> > > >
> > > >  > > >$link_id = mysql_connect("localhost","admin","***")
> > > > or die("Unable to connect to SQL server");
> > > > mysql_select_db("database",$link_id)
> > > > or die("Unable to select database");
> > > >  ?>
> > > >
> > > >   > > >
> > > > global $PHP_SELF
> > > >
> > > >?>
> > > >
> > > >   > > >   // echo $results;
> > > >?>
> > > >
> > > >
> > > > 
> > > > 
> > > > DB
> > > > 
> > > >
> > > > 
> > > >
> > > >  Home | Display All
> > > > | Search 
> > > > 
> > > > Total Entries:
> > > >  > > > $query = "SELECT COUNT(*) FROM gradients";
> > > > $num_count = mysql_query($query) or die("Select Failed!");
> > > > $count = mysql_fetch_array($num_count);
> > > >
> > > > ?>
> > > >
> > > > 
> > > > 
> > > > 
> > > >
> > > > http://dataguy/logo_small.jpg>
> > > >
> > > > Title for page
> > > >
> > > >  > > > INSERT INTO gradients (kwo, lsd, date, well, field, uni, license,
> > > > formation) VALUES ('$kwo', '$lsd', '$date', '$well', '$field',
> > > > '$uni', '$license', '$formation')
> > > > ?>
> > > >
> > > > 
> > > >  
> > > >   
> > > >  
> > > >
> > > > KWL WO#: 
> > > > LSD: 
> > > >  Date Completed: 
> > > > Well Name: 
> > > >  Fieled/Pool: 
> > > > Unique: 
> > > >   License #: 
> > > > Formation: 
> > > >   Perfs: 
> > > > Event No.: 
> > > >   Well Fluid Status: 
> > > > Well
> > > > Status Mode: 
> > > >Well Status Type: 
> > > > Type V/D/H: 
> > > >  File Name:  
> > > > KB: 
> > > > GRD: 
> > > > Open Hole: 
> > > >Sour: 
> > > > Tubing Size: 
> > > >Landed @: 
> > > > Casing Size: 
> > > >Landed @: 
> > > > Shut In Date: 
> > > >Shut In Time: 
> > > > Pres
> > > > TUB/CAS KPAg: 
> > > >Tag PBTD: 
> > > >
> > > >   
> > > > 
> > > >
> > > > 
> > > > 
> > > > 
> > > >
> > > >
> > > > 
> > > >
> > > > 
> > > > 
> > > >
> > > >
> > > >
> > > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> > > > news:[EMAIL PROTECTED]
> > > > > On Saturday 02 August 2003 01:46, Jeff wrote:
> > > > >
> > > > > > I tried doing this through the news server, but something
> > > > messed up.
> > > > > >
> > > > > > I just need to know how to make an HTML form write to a MySQL
> > > > DB.
> > > > > > This is what I have so far.
> > > > >
> > > > > [snip]
> > > > >
> > > > > And does it work? If it works then congratulations. If it doesn't
> > > > work, *how*
> > > > > doesn't it work.
> > > > >
> > > > > If you're new to all this, you might want to start by reading
> > > > some of the
> > > > > numerous tutorials available (google for them) and follow through
> > > > a few of
> > > > > them.
> > > > >
> > > > > --
> > > > > Jason

Re: [PHP-DB] MySQL

2003-08-01 Thread Mel Hodges
Myfault.. you should be using link_id instead of dbHandletry this:

$result = mysql_query($strSQL, $link_id) OR DIE("Error retrieving records.");






Quoting Jeff <[EMAIL PROTECTED]>:

> K, that got my a bit further, now it shows half the page but stops at the
> line:
> 
> $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> records.");
> 
> With error:
> 
> Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource
> in C:\FoxServ\www\encana_db.php on line 40
> Error retrieving records.
> 
> BTW, thank you everyone for your help.
> 
> 
> "Mel Hodges" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Try this:
> >
> > $strSQL = "INSERT INTO gradients (kwo, lsd, date, well, field, uni,
> license,
> > formation) VALUES
> > ('$kwo', '$lsd', '$date', '$well', '$field', '$uni', '$license',
> '$formation')";
> > $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> records.");
> >
> >
> >
> >
> >
> > Quoting Jeff <[EMAIL PROTECTED]>:
> >
> > > Yes I'm new at this - sorry for sounding like an idiot.  I'm a network
> guy,
> > > not a coder by any means - just learning.  (Company "project")
> > >
> > > > First of all, get rid of all those extraneous open and close (
> > > > ?> > >
> > > Done - it isn't the editor, I put them there - a lot of diffrent
> testing,
> > > and havn't had a changce to clean it up yet.
> > >
> > >  >(or is this code cobbled from
> > >  >other places?).
> > >
> > > No, that's plagerisum. :P  Doing this all form a book I purchased which
> > > dosn't cover MySQL as much as I had hoped.  Thats what I get for buying
> it
> > > online. :P
> > >
> > > >Second, the line in question is not valid PHP code.
> > >
> > > I figured as much, and did as you said, but it's still returning an
> error.
> > >
> > >  >It's SQL. Put it in quotes, assign it to a variable, and call it
> > >  >through a mysql_query() function.
> > >
> > > Error:  Parse error: parse error, unexpected T_STRING in
> > > C:\FoxServ\www\encana_db.php on line 36
> > >
> > > My new code:
> > >   > > $PHP_SELF = mysql_query(INSERT INTO gradients (kwo, lsd, date, well,
> field,
> > > uni, license, formation) VALUES ('$kwo', '$lsd', '$date', '$well',
> '$field',
> > > '$uni', '$license', '$formation') )
> > > ?>
> > >
> > > > --- Jeff <[EMAIL PROTECTED]> wrote:
> > > > > Sorry, I just realized that's an older copy of the code, here is
> > > > > the updated stuff - (It's just one more line, the line that's
> > > > > giving me greaf. :P  )
> > > > >
> > > > >  > > > >$link_id = mysql_connect("localhost","admin","***")
> > > > > or die("Unable to connect to SQL server");
> > > > > mysql_select_db("database",$link_id)
> > > > > or die("Unable to select database");
> > > > >  ?>
> > > > >
> > > > >   > > > >
> > > > > global $PHP_SELF
> > > > >
> > > > >?>
> > > > >
> > > > >   > > > >   // echo $results;
> > > > >?>
> > > > >
> > > > >
> > > > > 
> > > > > 
> > > > > DB
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > >  Home | Display All
> > > > > | Search 
> > > > > 
> > > > > Total Entries:
> > > > >  > > > > $query = "SELECT COUNT(*) FROM gradients";
> > > > > $num_count = mysql_query($query) or die("Select Failed!");
> > > > > $count = mysql_fetch_array($num_count);
> > > > >
> > > > > ?>
> > > > >
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > > http://dataguy/logo_small.jpg>
> > > > >
> > > > > Title for page
> > > > >
> > > > >  > > > > INSERT INTO gradients (kwo, lsd, date, well, field, uni, license,
> > > > > formation) VALUES ('$kwo', '$lsd', '$date', '$well', '$field',
> > > > > '$uni', '$license', '$formation')
> > > > > ?>
> > > > >
> > > > > 
> > > > >  
> > > > >   
> > > > >  
> > > > >
> > > > > KWL WO#: 
> > > > > LSD: 
> > > > >  Date Completed: 
> > > > > Well Name: 
> > > > >  Fieled/Pool: 
> > > > > Unique: 
> > > > >   License #: 
> > > > > Formation: 
> > > > >   Perfs: 
> > > > > Event No.: 
> > > > >   Well Fluid Status: 
> > > > > Well
> > > > > Status Mode: 
> > > > >Well Status Type: 
> > > > > Type V/D/H: 
> > > > >  File Name:  
> > > > > KB: 
> > > > > GRD: 
> > > > > Open Hole: 
> > > > >Sour: 
> > > > > Tubing Size: 
> > > > >Landed @: 
> > > > > Casing Size: 
> > > > >Landed @: 
> > > > > Shut In Date: 
> > > > >Shut In Time: 
> > > > > Pres
> > > > > TUB/CAS KPAg: 
> > > > >Tag PBTD: 
> > > > >
> > > > >   
> > > > > 
> > > > >
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > > 
> > > > >
> > > > >
> > > > >
> > > > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> > > > > news:[EMAIL PROTECTED]
> > > > > > On Saturday 02 August 2003 01:46, Jeff wrote:
> > > > > >
> > > > > > > I tried doing this through the news server, but something
> > > > > messe

Re: [PHP-DB] MySQL

2003-08-01 Thread Jeff
Oh, and another thing, in this book I have, they say to give the forum
action .

Yet it dosn't give a value to $PHP_SELF.

IS this correct?


"Jeff" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> K, that got my a bit further, now it shows half the page but stops at the
> line:
>
> $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> records.");
>
> With error:
>
> Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource
> in C:\FoxServ\www\encana_db.php on line 40
> Error retrieving records.
>
> BTW, thank you everyone for your help.
>
>
> "Mel Hodges" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Try this:
> >
> > $strSQL = "INSERT INTO gradients (kwo, lsd, date, well, field, uni,
> license,
> > formation) VALUES
> > ('$kwo', '$lsd', '$date', '$well', '$field', '$uni', '$license',
> '$formation')";
> > $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> records.");
> >
> >
> >
> >
> >
> > Quoting Jeff <[EMAIL PROTECTED]>:
> >
> > > Yes I'm new at this - sorry for sounding like an idiot.  I'm a network
> guy,
> > > not a coder by any means - just learning.  (Company "project")
> > >
> > > > First of all, get rid of all those extraneous open and close (
> > > > ?> > >
> > > Done - it isn't the editor, I put them there - a lot of diffrent
> testing,
> > > and havn't had a changce to clean it up yet.
> > >
> > >  >(or is this code cobbled from
> > >  >other places?).
> > >
> > > No, that's plagerisum. :P  Doing this all form a book I purchased
which
> > > dosn't cover MySQL as much as I had hoped.  Thats what I get for
buying
> it
> > > online. :P
> > >
> > > >Second, the line in question is not valid PHP code.
> > >
> > > I figured as much, and did as you said, but it's still returning an
> error.
> > >
> > >  >It's SQL. Put it in quotes, assign it to a variable, and call it
> > >  >through a mysql_query() function.
> > >
> > > Error:  Parse error: parse error, unexpected T_STRING in
> > > C:\FoxServ\www\encana_db.php on line 36
> > >
> > > My new code:
> > >   > > $PHP_SELF = mysql_query(INSERT INTO gradients (kwo, lsd, date, well,
> field,
> > > uni, license, formation) VALUES ('$kwo', '$lsd', '$date', '$well',
> '$field',
> > > '$uni', '$license', '$formation') )
> > > ?>
> > >
> > > > --- Jeff <[EMAIL PROTECTED]> wrote:
> > > > > Sorry, I just realized that's an older copy of the code, here is
> > > > > the updated stuff - (It's just one more line, the line that's
> > > > > giving me greaf. :P  )
> > > > >
> > > > >  > > > >$link_id = mysql_connect("localhost","admin","***")
> > > > > or die("Unable to connect to SQL server");
> > > > > mysql_select_db("database",$link_id)
> > > > > or die("Unable to select database");
> > > > >  ?>
> > > > >
> > > > >   > > > >
> > > > > global $PHP_SELF
> > > > >
> > > > >?>
> > > > >
> > > > >   > > > >   // echo $results;
> > > > >?>
> > > > >
> > > > >
> > > > > 
> > > > > 
> > > > > DB
> > > > > 
> > > > >
> > > > > 
> > > > >
> > > > >  Home | Display All
> > > > > | Search 
> > > > > 
> > > > > Total Entries:
> > > > >  > > > > $query = "SELECT COUNT(*) FROM gradients";
> > > > > $num_count = mysql_query($query) or die("Select Failed!");
> > > > > $count = mysql_fetch_array($num_count);
> > > > >
> > > > > ?>
> > > > >
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > > http://dataguy/logo_small.jpg>
> > > > >
> > > > > Title for page
> > > > >
> > > > >  > > > > INSERT INTO gradients (kwo, lsd, date, well, field, uni, license,
> > > > > formation) VALUES ('$kwo', '$lsd', '$date', '$well', '$field',
> > > > > '$uni', '$license', '$formation')
> > > > > ?>
> > > > >
> > > > > 
> > > > >  
> > > > >   
> > > > >  
> > > > >
> > > > > KWL WO#: 
> > > > > LSD: 
> > > > >  Date Completed: 
> > > > > Well Name: 
> > > > >  Fieled/Pool: 
> > > > > Unique: 
> > > > >   License #: 
> > > > > Formation: 
> > > > >   Perfs: 
> > > > > Event No.: 
> > > > >   Well Fluid Status: 
> > > > > Well
> > > > > Status Mode: 
> > > > >Well Status Type: 
> > > > > Type V/D/H: 
> > > > >  File Name:  
> > > > > KB: 
> > > > > GRD: 
> > > > > Open Hole: 
> > > > >Sour: 
> > > > > Tubing Size: 
> > > > >Landed @: 
> > > > > Casing Size: 
> > > > >Landed @: 
> > > > > Shut In Date: 
> > > > >Shut In Time: 
> > > > > Pres
> > > > > TUB/CAS KPAg: 
> > > > >Tag PBTD: 
> > > > >
> > > > >   
> > > > > 
> > > > >
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > >
> > > > > 
> > > > >
> > > > > 
> > > > > 
> > > > >
> > > > >
> > > > >
> > > > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> > > > > news:[EMAIL PROTECTED]
> > > > > > On Saturday 02 August 2003 01:46, Jeff wrote:
> > > > > >
> > > > > > > I tried doing this through the news server, but something

Re: [PHP-DB] MySQL

2003-08-01 Thread Jeff
Well, it worked for ONE submission  I was so excited. :)

Then I went back to enter another test, and when I went back to the page, it
displayed everything up to that line again, but JUST output, " Error
retrieving records. "

???  Why woudl it work just once?

"Mel Hodges" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Myfault.. you should be using link_id instead of dbHandletry this:
>
> $result = mysql_query($strSQL, $link_id) OR DIE("Error retrieving
records.");
>
>
>
>
>
>
> Quoting Jeff <[EMAIL PROTECTED]>:
>
> > K, that got my a bit further, now it shows half the page but stops at
the
> > line:
> >
> > $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> > records.");
> >
> > With error:
> >
> > Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource
> > in C:\FoxServ\www\encana_db.php on line 40
> > Error retrieving records.
> >
> > BTW, thank you everyone for your help.
> >
> >
> > "Mel Hodges" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Try this:
> > >
> > > $strSQL = "INSERT INTO gradients (kwo, lsd, date, well, field, uni,
> > license,
> > > formation) VALUES
> > > ('$kwo', '$lsd', '$date', '$well', '$field', '$uni', '$license',
> > '$formation')";
> > > $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> > records.");
> > >
> > >
> > >
> > >
> > >
> > > Quoting Jeff <[EMAIL PROTECTED]>:
> > >
> > > > Yes I'm new at this - sorry for sounding like an idiot.  I'm a
network
> > guy,
> > > > not a coder by any means - just learning.  (Company "project")
> > > >
> > > > > First of all, get rid of all those extraneous open and close (
> > > > > ?> > > >
> > > > Done - it isn't the editor, I put them there - a lot of diffrent
> > testing,
> > > > and havn't had a changce to clean it up yet.
> > > >
> > > >  >(or is this code cobbled from
> > > >  >other places?).
> > > >
> > > > No, that's plagerisum. :P  Doing this all form a book I purchased
which
> > > > dosn't cover MySQL as much as I had hoped.  Thats what I get for
buying
> > it
> > > > online. :P
> > > >
> > > > >Second, the line in question is not valid PHP code.
> > > >
> > > > I figured as much, and did as you said, but it's still returning an
> > error.
> > > >
> > > >  >It's SQL. Put it in quotes, assign it to a variable, and call it
> > > >  >through a mysql_query() function.
> > > >
> > > > Error:  Parse error: parse error, unexpected T_STRING in
> > > > C:\FoxServ\www\encana_db.php on line 36
> > > >
> > > > My new code:
> > > >   > > > $PHP_SELF = mysql_query(INSERT INTO gradients (kwo, lsd, date, well,
> > field,
> > > > uni, license, formation) VALUES ('$kwo', '$lsd', '$date', '$well',
> > '$field',
> > > > '$uni', '$license', '$formation') )
> > > > ?>
> > > >
> > > > > --- Jeff <[EMAIL PROTECTED]> wrote:
> > > > > > Sorry, I just realized that's an older copy of the code, here is
> > > > > > the updated stuff - (It's just one more line, the line that's
> > > > > > giving me greaf. :P  )
> > > > > >
> > > > > >  > > > > >$link_id = mysql_connect("localhost","admin","***")
> > > > > > or die("Unable to connect to SQL server");
> > > > > > mysql_select_db("database",$link_id)
> > > > > > or die("Unable to select database");
> > > > > >  ?>
> > > > > >
> > > > > >   > > > > >
> > > > > > global $PHP_SELF
> > > > > >
> > > > > >?>
> > > > > >
> > > > > >   > > > > >   // echo $results;
> > > > > >?>
> > > > > >
> > > > > >
> > > > > > 
> > > > > > 
> > > > > > DB
> > > > > > 
> > > > > >
> > > > > > 
> > > > > >
> > > > > >  Home | Display
All
> > > > > > | Search 
> > > > > > 
> > > > > > Total Entries:
> > > > > >  > > > > > $query = "SELECT COUNT(*) FROM gradients";
> > > > > > $num_count = mysql_query($query) or die("Select Failed!");
> > > > > > $count = mysql_fetch_array($num_count);
> > > > > >
> > > > > > ?>
> > > > > >
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >
> > > > > > http://dataguy/logo_small.jpg>
> > > > > >
> > > > > > Title for page
> > > > > >
> > > > > >  > > > > > INSERT INTO gradients (kwo, lsd, date, well, field, uni,
license,
> > > > > > formation) VALUES ('$kwo', '$lsd', '$date', '$well', '$field',
> > > > > > '$uni', '$license', '$formation')
> > > > > > ?>
> > > > > >
> > > > > > 
> > > > > >  
> > > > > >   
> > > > > >  
> > > > > >
> > > > > > KWL WO#: 
> > > > > > LSD: 
> > > > > >  Date Completed: 
> > > > > > Well Name: 
> > > > > >  Fieled/Pool: 
> > > > > > Unique: 
> > > > > >   License #: 
> > > > > > Formation: 
> > > > > >   Perfs: 
> > > > > > Event No.: 
> > > > > >   Well Fluid Status: 
> > > > > > Well
> > > > > > Status Mode: 
> > > > > >Well Status Type: 
> > > > > > Type V/D/H: 
> > > > > >  File Name:  
> > > > > > KB: 
> > > > > > GRD: 
> > > > > > Open Hole: 
> > > > > >Sour: 
> > > > > > Tu

Re: [PHP-DB] MySQL

2003-08-01 Thread Jeff
GAH!  I don't userstand why this woudl work onyl once, then return a
Error retrieving records.I've even recreated the sql DB, same result.
"Jeff" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well, it worked for ONE submission  I was so excited. :)
>
> Then I went back to enter another test, and when I went back to the page,
it
> displayed everything up to that line again, but JUST output, " Error
> retrieving records. "
>
> ???  Why woudl it work just once?
>
> "Mel Hodges" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Myfault.. you should be using link_id instead of dbHandletry this:
> >
> > $result = mysql_query($strSQL, $link_id) OR DIE("Error retrieving
> records.");
> >
> >
> >
> >
> >
> >
> > Quoting Jeff <[EMAIL PROTECTED]>:
> >
> > > K, that got my a bit further, now it shows half the page but stops at
> the
> > > line:
> > >
> > > $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> > > records.");
> > >
> > > With error:
> > >
> > > Warning: mysql_query(): supplied argument is not a valid MySQL-Link
> resource
> > > in C:\FoxServ\www\encana_db.php on line 40
> > > Error retrieving records.
> > >
> > > BTW, thank you everyone for your help.
> > >
> > >
> > > "Mel Hodges" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > Try this:
> > > >
> > > > $strSQL = "INSERT INTO gradients (kwo, lsd, date, well, field, uni,
> > > license,
> > > > formation) VALUES
> > > > ('$kwo', '$lsd', '$date', '$well', '$field', '$uni', '$license',
> > > '$formation')";
> > > > $result = mysql_query($strSQL, $dbHandle) OR DIE("Error retrieving
> > > records.");
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Quoting Jeff <[EMAIL PROTECTED]>:
> > > >
> > > > > Yes I'm new at this - sorry for sounding like an idiot.  I'm a
> network
> > > guy,
> > > > > not a coder by any means - just learning.  (Company "project")
> > > > >
> > > > > > First of all, get rid of all those extraneous open and close (
> > > > > > ?> > > > >
> > > > > Done - it isn't the editor, I put them there - a lot of diffrent
> > > testing,
> > > > > and havn't had a changce to clean it up yet.
> > > > >
> > > > >  >(or is this code cobbled from
> > > > >  >other places?).
> > > > >
> > > > > No, that's plagerisum. :P  Doing this all form a book I purchased
> which
> > > > > dosn't cover MySQL as much as I had hoped.  Thats what I get for
> buying
> > > it
> > > > > online. :P
> > > > >
> > > > > >Second, the line in question is not valid PHP code.
> > > > >
> > > > > I figured as much, and did as you said, but it's still returning
an
> > > error.
> > > > >
> > > > >  >It's SQL. Put it in quotes, assign it to a variable, and call it
> > > > >  >through a mysql_query() function.
> > > > >
> > > > > Error:  Parse error: parse error, unexpected T_STRING in
> > > > > C:\FoxServ\www\encana_db.php on line 36
> > > > >
> > > > > My new code:
> > > > >   > > > > $PHP_SELF = mysql_query(INSERT INTO gradients (kwo, lsd, date,
well,
> > > field,
> > > > > uni, license, formation) VALUES ('$kwo', '$lsd', '$date', '$well',
> > > '$field',
> > > > > '$uni', '$license', '$formation') )
> > > > > ?>
> > > > >
> > > > > > --- Jeff <[EMAIL PROTECTED]> wrote:
> > > > > > > Sorry, I just realized that's an older copy of the code, here
is
> > > > > > > the updated stuff - (It's just one more line, the line that's
> > > > > > > giving me greaf. :P  )
> > > > > > >
> > > > > > >  > > > > > >$link_id = mysql_connect("localhost","admin","***")
> > > > > > > or die("Unable to connect to SQL server");
> > > > > > > mysql_select_db("database",$link_id)
> > > > > > > or die("Unable to select database");
> > > > > > >  ?>
> > > > > > >
> > > > > > >   > > > > > >
> > > > > > > global $PHP_SELF
> > > > > > >
> > > > > > >?>
> > > > > > >
> > > > > > >   > > > > > >   // echo $results;
> > > > > > >?>
> > > > > > >
> > > > > > >
> > > > > > > 
> > > > > > > 
> > > > > > > DB
> > > > > > > 
> > > > > > >
> > > > > > > 
> > > > > > >
> > > > > > >  Home | Display
> All
> > > > > > > | Search 
> > > > > > > 
> > > > > > > Total Entries:
> > > > > > >  > > > > > > $query = "SELECT COUNT(*) FROM gradients";
> > > > > > > $num_count = mysql_query($query) or die("Select Failed!");
> > > > > > > $count = mysql_fetch_array($num_count);
> > > > > > >
> > > > > > > ?>
> > > > > > >
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >
> > > > > > > http://dataguy/logo_small.jpg>
> > > > > > >
> > > > > > > Title for page
> > > > > > >
> > > > > > >  > > > > > > INSERT INTO gradients (kwo, lsd, date, well, field, uni,
> license,
> > > > > > > formation) VALUES ('$kwo', '$lsd', '$date', '$well', '$field',
> > > > > > > '$uni', '$license', '$formation')
> > > > > > > ?>
> > > > > > >
> > > > > > > 
> > > > > > >  
> > > > > > >   
> > > > > > >  
> > > > > > >
> > > > > > > KWL WO#: 
> > > > > > > 

[PHP-DB] Mysql Query

2003-08-23 Thread Mohammad Saadullah
Hi guys,

I have been working in php/oracle for quite some time now but recently had to shift 
myself to mysql and I am struggling with a particular query here.

Scenario is, certain researchers can submit their proposals and those proposal are 
stored in a table researcher. 
proposals are of 2 types lets say type 1 and type 2.
Later they can view their own submited proposals which is working fine, but there is 
one new condition now.What my client wants is that these researchers can view all 
proposals of type 2 but only those proposals of type 1 should be displayed to a 
researcher whose submit date is greater than a certain date lets say '2003-08-01'. Now 
how do I create a single query which can return me such results. I know there is a way 
with join but cant find a solution, with oracle I would have used sub query but that 
cannot be done on mysql so I need your guys help thanks

Table name: researcher

Concerned fields
pid <-- porposal id
rid <-- researcher id
ptype <--- proposal type
submitd <-- submission date.

I would use rid = 42 and for ptype = 1 submitd should be greater than '2003-08-01' and 
there is no restriction of date with ptype =2.

Thanks again.
if there is something not clear feel free to ask

[PHP-DB] MySql backup

2003-11-25 Thread Robin Kopetzky
Question - if I stop MySql using WinMySqladmin on NT4.0, will I be able to
completely backup the data directory or do I need to do something else? This
is a commercial application that I need to backup, so it's mighty darned
important.

Any help is appreciated.

Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] mysql + php

2003-12-08 Thread Will Contact
hi!
(B
(BI  am first question of php in this news group. I would like to ask my 
(Bquestion about
(Bphp + mysql. Now I am  programming php+mysql.  I put word, excel, mpeg and 
(Bany binaries into
(Bthe mySQL database using php on linux server,But I can take out these binay 
(Bfrom mySQL database. I would like to see the files and save my pc from 
(Bserver. So how can I take out from
(Bthese binaries? If you know it how to take out and show it, please teach 
(Band help me how!!.
(BThe information table of mySQL is "objects." So here is the program below;
(B
(B// database information
(Bcreate table objects
(B  b_col blob,
(B  name varchar(30),
(B  file_size varchar(30),
(B  file_date datetime
(B}
(B// it works from "insert" SQL  abc.php
(B$db = mysql_connect("*", "***", "");
(Bmysql_select_db("***",$db);
(B$sql_insert = "INSERT INTO objects(b_col, file_name, file_size, 
(Bfile_type,file_date) VALUES  
(B('$UploadedFile','$UploadedFile_name','$UploadedFile_size','$UploadedFile_type',now())";
(B
(B   mysql_query($sql_insert);
(B
(B//
(B// But it does not work at. I can not see anything in my browser
(B$sql_select = "select b_col, file_name, file_size, file_type, file_date 
(Bfrom objects where  file_name like 'gball.gif'";
(B	if(!($result=mysql_query($sql_select,$db))){
(B  			die;
(B  	}
(B
(B   $file_name = mysql_result ($result,0,"file_name");
(B   echo $file_name; 
(B
(B
(B
(BRegards,
(Bjames
(B
(B_
$BM'C#$H(B24$B;~4V%[%C%H%i%$%s!V(BMSN $B%a%C%;%s%8%c!http://messenger.msn.co.jp 
(B
(B-- 
(BPHP Database Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] MySQL Insert

2004-01-07 Thread Will W
Hello Everyone,
Can anyone tell me how to insert a file, say a .doc, .txt or a .rtf file into a table 
from an upload form??

Thanks in advance,
~~Will~~


[PHP-DB] mysql query

2013-08-21 Thread Ethan Rosenberg

Dear List -

I can't figure this out

mysql> describe Inventory;
+-+-+--+-+-+---+
| Field   | Type| Null | Key | Default | Extra |
+-+-+--+-+-+---+
| UPC | varchar(14) | YES  | | NULL |   |
| quant   | int(5)  | NO   | | NULL |   |
| manuf   | varchar(20) | YES  | | NULL |   |
| item| varchar(50) | YES  | | NULL |   |
| orderpt | tinyint(4)  | NO   | | NULL |   |
| ordrpt_flag | tinyint(3)  | YES  | | NULL |   |
| stock   | int(3)  | YES  | | NULL |   |
+-+-+--+-+-+---+

Here are code snippets -

  $upc   = $_SESSION['UPC'];
  $qnt   = $_POST['quant'];
  $mnf   = $_POST['manuf'];
  $itm   = $_POST['item'];
  $odrpt = $_POST['oderpt'];
  $opf   = $_POST['ordrpt_flag'];
  $stk= $_POST['stock'];

  $sql2 = "insert into Inventory (UPC, quant, 
manuf, item, orderpt, ordrpt_flag, stock)"
."values ('$upc', $qnt,'$mnf','$itm', 
odrpt, 0, $stk)";

  $result2 = mysqli_query(cxn, $sql2);
  echo '$sql2';
  print_r($sql2);
  echo "$upc $qnt $mnf $itm $odrpt $opf 
$stk";

  if (!$result2)
die('Could not enter data: ' . 
mysqli_error());


The mysql query fails.  I cannot figure out why.  It works from the 
command line.


TIA

Ethan




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
Hello everyone,
Long time. Hope all are well.

Quick question. How should MySQL connections be treated?
Is it ok to leave them open or is it better to close them after transactions?
I have a website that uses sessions and was wondering if there was any 
situations where I should be closing the connection.
Either for performance reasons or security or best practices. 

Just wondering your professional.

TIA

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com 






[PHP-DB] MYSQL query help

2001-12-14 Thread Harpreet

I dont think we can use 'IN' and 'NOT IN' in mysql. Is there an alternative
that would work?

select * from lib_asset_tbl where material_id <>'' and asset_id in (select
asset_id from lib_copy_tbl)

Help is appreciated.

Regards,
Harpreet Kaur
Software Developer
Crispin Corporations Inc.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] mysql EXPLAIN

2001-12-14 Thread Chris Hobbs

http://www.mysql.com/doc/E/X/EXPLAIN.html

Sharmad Naik wrote:

> How do i get all the info for mysql just the EXPLAIN statement in postgres


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL date formats

2001-12-20 Thread nautilis

Hi everyone!

I have a little problem with my MySQL database in the way it stores dates.
The only format i can have is /MM/DD, and when i request this date from
my php page, this date is insertes in this format. As my website is going to
be for spanish users, the correct format would be DD/MM/, but i have no
idea about changing this, either on the database or when i process it with
php.

Thanks in advance for reading my post. I hope anyone can point me into the
right direction.

nautilis



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL Result Resource

2002-01-10 Thread Necro

Lo all,

Slight problem on an auth script...


Warning: Supplied argument is not a valid MySQL result resource in
d:\htdocs\infekt\packages\auth.inc on line 104


Line 26:  define( "DATABASE", "imanager" );
Line 103: $arg = "select password, 1 as auth from acl where
username='$username' and password=MD5('$username','$password')";
Line 104: $row = mysql_fetch_array(mysql_db_query( DATABASE, $arg ));


Can anyone help get this to work??

Thankyou.

Andrew


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] mysql query file

2002-01-17 Thread John Cuthbert

Hello.
I am wishing to store all mysql querys in a single file and when they needed
to be ran call them using include "mysql.php";
But I keep getting errors saying that its an invalid number of mysql
resoruces or something like that when I bring the query into the atuual file
and dont run it from the extra one it works perfectly. Anyone know how to do
it right ?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL database

2002-01-19 Thread Miles Thompson

Morten,

What's your level of knowledge of both databases and PHP?  Please have a 
look at the Introductory Tutorial (Link at the top left of www.php.net). At 
the end of that tutorial, which is admittedly rudimentary, there are links 
to more advanced ones, including ones specifically for user authentication.

Regards - Miles Thompson

At 06:08 PM 1/19/2002 +0100, Morten Nielsen wrote:
>Hi,
>
>Could anybody explain to me how I should make a table with usernames and
>passwords.
>I want to make a site, where users can sign up and enter some values, which
>is stored in a different table.
>How do I grant the necessary acces to the tables, so users can enter values
>into them?
>
>Please help,
>Morten
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL database

2002-01-19 Thread Miles Thompson

As Brian Clark just pointed out on php-general, in response to another 
issue ...
http://www.faqts.com/knowledge_base/index.phtml/fid/51/

Some very specific refernces. You'll find what you need there.

Miles

At 06:08 PM 1/19/2002 +0100, Morten Nielsen wrote:
>Hi,
>
>Could anybody explain to me how I should make a table with usernames and
>passwords.
>I want to make a site, where users can sign up and enter some values, which
>is stored in a different table.
>How do I grant the necessary acces to the tables, so users can enter values
>into them?
>
>Please help,
>Morten
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Mysql-class

2002-01-20 Thread Jason Wong

On Monday 21 January 2002 21:52, Johannes Hiemer wrote:
> Hi,
> i coded a Mysql-Class, there are no compiling-errors when i run it.
> But the problem is that it doesn´t do what i want it to do.
> I added the sourcecode below and would be happy for any sugestions
> how to make it better.

[snip]

What did you want it to do? 

What is it doing now? 

What error does it give, if any?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Always there remain portions of our heart into which no one is able to enter,
invite them as we may.
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Mysql-class

2002-01-21 Thread Jason Wong

On Tuesday 22 January 2002 22:35, Johannes Hiemer wrote:

First of all, please keep the discussion on the list!

> >What did you want it to do?
>
> I want it to do things like inserting into Mysql-dbs
> Fetching arrays. Just every Mysql-command which
> Is also suported in PHP.
> What is it doing now?
> It is doing nothing if I create a class of it.
> If I create a  class using the fetch_array function
> And echoing it after it just says: Object.
> What error does it give, if any?
> S. a.

Looking back at your code:

>  $test = new get_db();
>  $test -> connect();
>  $test -> db_query("SELECT * FROM topics");
>  $test -> fetch_array("SELECT * FROM topics");
>  echo "$test";


You should be using:

  $test->connect();

etc (note there are no spaces surrounding the "->").

BTW, I'm not trying to put you off, but why are you writing your own class of 
mysql db functions? There are already loads out there which are tested (and 
working!). If this is an exercise in learning how to write classes then good 
luck :)


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
The perfect lover is one who turns into a pizza at 4:00 A.M.
-- Charles Pierce
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] mySQL 4.0.2-alpha

2002-01-28 Thread Paul Stevens

Hi guys,

I'm running mySQL 3.23.43 at the mo' with PHP-GTK 0.5.0. Long and the short
of the matter is, anyone running mySQL 4.0.2-alpha in anywhere near a
production 
environment yet, and if so, how is it? My server is a Win2K Server SP2
box...so how steady are those windows binaries??? :-)

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL Connection Class

2002-01-30 Thread jas

I know this may seem a little vague but I would like to know where a good
tutorial on creating database connection class files would be.  I have been
looking and as of yet I have not found one that deals specifically with this
question.  Thanks in advance.
Jas



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL connect

2002-02-04 Thread Ken Thompson

On Monday 04 February 2002 10:54 am, you wrote:
> Hi all,
>
> Ok I am learning this on my own but I could use some help.
> I have started these two pages test.php and config.php here is the code:
>
> test.php
>
>  // include the database configuration
> include "config.php";

In looking at my "include" page I noticed there were parenthisis around the 
include statement, maybe this is your problem.
include("header.inc");

> // connect to database
> mysql_connect($db["host"],$db["user"],$db["password"],$db["database"]) or
> die ("sorry not successful");
>
> // if no connect then exit
> exit;
>
> // if connect successful
> echo ("you have connected");
> ?>
>
> config.php
>
> 
> // database config
> $db["host"] = "localhost";
> $db["user"] = "me";
> $db["password"] = "mypassword";
> $db["database"] = "mydb";
>
> ?>
>
> All I'm trying to do is successfully connect to the database but it returns
> "sorry not successful". What have I done wrong?
> I have gone straight from the php pocket reference manual and it doesn't
> work. Would someone please explain what has happened?
>
> Thanks
> J Leonard



-- 
Ken Thompson, North West Antique Autos
Payette, Idaho
Email: [EMAIL PROTECTED]
http://www.nwaa.com
Sales and brokering of antique autos and parts.

Linux- Coming Soon To A Desktop Near You
Registered Linux User #183936

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL connect

2002-02-04 Thread Paul Burney

on 2/4/02 12:54 PM, J Leonard at [EMAIL PROTECTED] appended the following
bits to my mbox:

> mysql_connect($db["host"],$db["user"],$db["password"],$db["database"]) or

The above function call only has three parameters.   The database isn't
specified in the connect call but selected later. Try:

mysql_connect($db["host"],$db["user"],$db["password"]);
mysql_select_db($db["database"])

Paul





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL connect

2002-02-04 Thread Gurhan Ozen

mysql_connect() function only takes 3 arguments (servername, username, pass)
.
Select your database by using mysql_select_db() function...
Try to rewrite the code as:

mysql_connect($db["host"],$db["user"],$db["password"]);
mysql_select_db($db["database"]);

Refer to:
http://www.php.net/manual/en/ref.mysql.php

Gurhan


-Original Message-
From: J Leonard [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 12:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL connect


Hi all,

Ok I am learning this on my own but I could use some help.
I have started these two pages test.php and config.php here is the code:

test.php



config.php



All I'm trying to do is successfully connect to the database but it returns
"sorry not successful". What have I done wrong?
I have gone straight from the php pocket reference manual and it doesn't
work. Would someone please explain what has happened?

Thanks
J Leonard





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mySQL dB copy

2002-02-11 Thread mike

Hello all,

I am a relatively new php/mysql developer, I would like to take an entire
mysql and copy it or strip it from the server where it resides.  Anyone know
how to do this?  Recently a previous developer had made a cgi shopping cart
that I would like to take the product table from and make php shopping cart
product table, but I need that data in a state where I can manipulate it.
Copy it, change column names and so on.  The table is roughly 1000 products
large.  Any help would be greatly appreciated.

if you can email at mailto:[EMAIL PROTECTED]

Thanks
Mike



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL gets blind!

2002-02-14 Thread João Verde


Hi!

On a site I'm developing I need to conduct boolean searches. I use a
piece of code I found on:

http://www.evolt.org/article/comment/18/15665/

and I've got to say it works really well.

The problem is I cannot search for one specific word because, even
though the word exists on several records, MySQL never returns any
rows.

The word I can't look for is "portaria". Any other word works just
fine. I have tried every word I could think of and it works... except
for that one: "portaria".

Here is the syntax:

SELECT *, match (titulo,estado,sumario,categoria,tipo,pachave)
against (' portaria ') as relevance FROM dgf_net.dgf_lex WHERE match
(titulo,estado,sumario,categoria,tipo,pachave) against ('portaria')>0
HAVING relevance>0 ORDER BY relevance DESC

And here is a view of the table:


Field Type Attributes Null Default Extra
id  int(11)   Noauto_increment
insdata  datetime   No  -00-00 00:00:00
startdata  datetime   No  -00-00 00:00:00
area  tinytext   No
autor  varchar(255)   No
titulo  varchar(255)   No
subtitulo  varchar(255)   No
texto  text   No
anexo  tinytext   No
pachave  varchar(255)   No
obs  tinytext   No
activo  char(1)   No  N
validade  datetime   No  -00-00 00:00:00
imagem  varchar(255)   No
cafe  varchar(8)   No


Indexes :
Keyname Type Cardinality Field
PRIMARY  PRIMARY  31  id
id  INDEX  None  id
titulo  FULLTEXT  None  titulo
subtitulo
texto  1
pachave


I'm puzzled! Why is MySQL picky about this specific word?
MySQL is 3.23.36 and PHP 4.0.4pl1

Any help is appreciated! :-)


jcv

:: cdb.pnorte.pt :: #26527125 ::
:: 02-14-2002 21:12:07 ::
:: A beer doesn't mind when your mother visits.



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mysql and auto_increment

2002-02-20 Thread Nautilis

Hi everyone

My question is very simple, so i hope the answer will too :)

Well i have an index field in my table which is set as auto_increment. Well
question is, it's possible that mysql use values that have alredy been
deleted from older regs?

Thx in advance!




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL problem

2002-02-21 Thread Markus Lervik

On Fri, 2002-02-22 at 09:37, Caleb Walker wrote:
> I keep on getting this error statement:
> Warning: Supplied argument is not a valid MySQL result resource in 
> /usr/local/www/data/phone/insert2.php on line 10
> 2
> 
> Can someone tell me what is wrong with the code below, I just cannot figure 
> it out... Thank you very much in advance.  I am using php4.
> 
> 
>  session_start();
> include("info.inc.php");
> 
> mysql_connect("$host","$user","$pass") || die(mysql_error());
> mysql_select_db("$db") || die(mysql_error());
> 
> 
> $q = mysql_query("SELECT FName, LName FROM user_info WHERE (FName='$FName' && 
> LName='$LName')") || die(1);

Try this out:

$q = mysql_query("SELECT FName, LName FROM user_info WHERE
(FName='$FName' && LName='$LName')",$db) || die(1);
^^^

It might help. Or it might not :)


Cheers,
Markus

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Result

2002-03-08 Thread DL Neil

Hi Chris

> I have delete working perfectly by doing the following:
>
> include("connectionstart.php");
>
> mysql_query ("DELETE FROM emaillist WHERE EMail = '$email'
> ");
>
> However, how do I return a true or false flag whether the row was
deleted or
> not?  I basically need to know how to do a 0 or 1 I guess once the row
has
> been deleted or if the specified email address wasn't found.


The manual is your friend
(http://www.php.net/manual/en/function.mysql-query.php)
There are a couple of reasons why a query/DELETE might fail.
Most command checking code failure occurs because people fail to
appreciate that the return-value from mysql_query() takes advantage of
PHP's loose (data) typing, and can be a boolean value sometimes, and a
resource 'pointer' at others.
The next 'hole' to fall into is the correctness of the syntax of the
query, or that the connection between PHP and MySQL has been broken/not
established - illustrated in the manual ref given.
The second 'level' of the game is (as you ask) to check that MySQL was
actually able to do what was instructed. For this you need
mysql_affected_rows() (manual:
http://www.php.net/manual/en/function.mysql-affected-rows.php)

Here's a particularly pedantic (but hopefully illustrative)piece of code
for you:
  ...
   if ( DEBUG ) echo "Query=$SQLquery~";
 $bValidity   = $MySQLResultSet
= @mysql_query( $SQLquery, $MySQLConnection );
 $iNumRowsDeleted = mysql_affected_rows( $MySQLConnection );
 if ( MYSQL_DEBUG ) echo "Result=$MySQLResultSet~ Num
rows=$iNumRowsDeleted~";
 if ( FALSE == $bValidity )
 {
  MySQLdbError( $MySQLConnection,
"Error: MySQL DELETE syntax/semantic/privilege error" );
 }
 return $bValidity;

- the DELETE is performed within a function
- DEBUG and MYSQL_DEBUG are script-global constants set/reset according
to taste
- MySQLdbError() logs any errors, in or out of user view, also according
to taste
- note that the query is error-suppressed and its result assigned twice
to vars of different types (by naming convention if not PHP construct)
- the function returns a 'worked' or 'didn't' (boolean) value
- other values are returned in the function parameter/argument list, eg
the number of rows deleted
- the mainline can call the function within an IF statement
- the IF-valid check can then proceed to inspect $iNumRowsDeleted to
ensure expected behavior

Other refs: a number of the tutorials linked from MySQL AB's site cover
this topic area.

Regards,
=dn


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Result

2002-03-08 Thread Mike Maltese


mysql_affected_rows(int resource_id);

This will return the number of rows that were affected by the last
operation, so you could do something like this:

if(mysql_affected_rows($connection) == 1){
//insert, update or delete succeeded
}else{
//operation failed
}

- Original Message -
From: "Chris Payne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 07, 2002 7:34 PM
Subject: [PHP-DB] MySQL Result


> Hi there everyone,
>
> I have delete working perfectly by doing the following:
>
> include("connectionstart.php");
>
> mysql_query ("DELETE FROM emaillist WHERE EMail = '$email'
> ");
>
> However, how do I return a true or false flag whether the row was deleted
or
> not?  I basically need to know how to do a 0 or 1 I guess once the row has
> been deleted or if the specified email address wasn't found.
>
> Thanks for your help everyone.
>
> Chris
>
>
> --
> PHP Database Mailing List (http://www.php   /)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL/PHP Update

2002-03-27 Thread Jason

I'm trying to update my MySQL database, but it doesn't seem to be taking.

my code is:

mysql_query("update prod_list set prod_manu=$prod_man where sku='$prod'");

where
prod_manu is an int
$prod_man is an int
sku is a varchar
$prod is text

mysql_query() comes back successful, and just to be sure I echoed
mysql_error() and nothing came back.

What am I doing wrong?




[PHP-DB] MySQL, PHPand cron

2002-03-28 Thread Jennifer Downey

Hi all,

Wondering if anyone might know how to empty a table with a php script and
cron job?
Would someone point me to a tutorial or help with this?

TIA
Jennifer



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mysql joining 101

2002-03-30 Thread Matthew Crouch

Here's an easy one that I can't find laid out for me anywhere:
I want a self join that pairs up the id numbers of a table in every
permutation

e.g. i have id #s 1, 2, and 3
i need this result:
1 2
1 3
2 1
2 3
3 2
3 1

clear enough?


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL Search problem

2002-04-10 Thread Terry Huffman

Can anyone tell me what is wrong with the code that is below?  Whenever I use this it 
returns all the records in the table no matter what is searched for.

Thanks for any help,

Terry

-- CODE 

Search results:";

echo "";

do {

echo "".$myrow["Player"]."";

} while ($myrow=mysql_fetch_array($result)); // start loop over to output more because 
$myrow was set again

echo "";

?>

- END CODE --

--- FORM 









Players First Name









Players Last Name









College









Year Drafted 

Any

1968

1969

1970

1971

1972

1973

1974

1975

1976

1977

1978

1979

1980

1981

1982

1983

1984

1985

1986

1987

1988

1989

1990

1991

1992

1993

1994

1995

1996

1997

1998

1999

2000

2001

2002









Round Drafted 









Position

Any

Offense

Defense

Special Teams











Year With the team

Any

1968

1969

1970

1971

1972

1973

1974

1975

1976

1977

1978

1979

1980

1981

1982

1983

1984

1985

1986

1987

1988

1989

1990

1991

1992

1993

1994

1995

1996

1997

1998

1999

2000

2001

2002











Uniform Number






















Re: [PHP-DB] mysql tables

2002-04-24 Thread Miles Thompson

Read the MySQL docs and find out!
MT
At 10:27 AM 4/24/2002 +0300, Marius Ursache wrote:
>hi
>
>how many columns can have a mysql table?
>
>tnx
>
>--
>   Marius Ursache (3563 || 3494)
>
>\|/  \|/
>"@'/ ,. \`@"
>/_| \__/ |_\
>   \__U_/
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Query

2002-05-03 Thread Alnisa Allgood

At 1:01 PM +0100 5/3/02, CM wrote:
>SELECT Periode.LibPeriode, PaysPeriode.RefPaysPeriode,
>PaysPeriode.DateDebut,PaysPeriode.DateFin
>FROM Periode, PaysPeriode, Pays
>WHERE Pays.RefPays = PaysPeriode.Refpays
>AND Periode.RefPeriode = PaysPeriode.RefPeriode
>AND PaysPeriode.DateDebut > 2002020700
>AND Pays.RefPays = 1
>ORDER BY Periode.libPeriode, PaysPeriode.DateDebut
>
>This is soo close to working but just not quite. The Access query just
>pulled out unique values for the Periode.LibPeriod field which was perfect.
>But the MySQL seems to pull them all out. I have tried GROUPING the result
>by the Periode.LibPeriode which gives me unique values in the field but I
>need the unique values with the highest startdate i.e. PaysPeriode.DateDebut
>but it always pulls out the first start date?

I'd add a Max() function with the Group By, like...

SELECT Periode.LibPeriode, PaysPeriode.RefPaysPeriode,
MAX(PaysPeriode.DateDebut), PaysPeriode.DateFin

FROM Periode, PaysPeriode, Pays

WHERE Pays.RefPays = PaysPeriode.Refpays
AND Periode.RefPeriode = PaysPeriode.RefPeriode
AND PaysPeriode.DateDebut > 2002020700
AND Pays.RefPays = 1

GROUP BY Periode.libPeriode

ORDER BY Periode.libPeriode, PaysPeriode.DateDebut

I'm not certain why your Access query only pulled one record. From 
the skim, it seems as if it should pull all that match, since you 
didn't indicate you wanted only those distinctly, or a max value. 
Though often an Inner Join can act as a limiter as well, so that 
maybe why it worked.

But anyway, the find all records, max or min of the value you want, 
group records (max, min, ave, count , etc. functions all REQUIRE the 
Group By, you'll generate an error if you forget it), then order 
them, should work.

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
transforming nonprofits through technology
   .

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mysql connection problem

2002-05-18 Thread Christian Weilbach

hi
i've added a new apache 2.0.35 server with an php 4.2.0 module to my
machine, but always when this php-module tries to connect my mysql server
(on the same machine) this error:

Host 'weilbach' is not allowed to connect to this MySQL server

appears. my other apache 1.3.23 server with php 4.1.2 works perfectly. i've
tried to use the same php.ini file but it doesn't help...
i would be very happy if some one can help me

christian weilbach



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Problem

2002-05-21 Thread Gurhan Ozen

That means PHP is not compiled with the MySQL support... Configure it with
mysql support, I bbelieve there were a lot of questions about this in the
list, so you may wanna search the archives..

Gurhan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 21, 2002 8:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Problem


Hi, i've a problem with MySQL in my PHP pages. My PHP version is 4.0.1 i
think. it's been installed with Redhat Linux 7.2 with default MySQL support.
(I've verified it). when i want to connect to my sample MySQL database, it
give me error :
Call to undifined function mysql_connect
with all MySQL functions, i've the same error. what's problem? and what i
can do? please somebody help me.

Many thanks, Alan


mail2web - Check your email from the web at
http://mail2web.com/ .


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL Clustering, redundancy

2002-06-18 Thread Matt Babineau

Hi All:
 
I quickly skimmed the MySQL manual and didn't see any information on
clustering. Does MySQL have any support for clustering or some type of
redundant failover systems?
 
Thanks!
 
Matt Babineau
Freelance Internet Developer
-
e:   [EMAIL PROTECTED]
p: 603.943.4237
w:   http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
 



[PHP-DB] MYSQL Socket error :\

2002-06-21 Thread Marco Lanini

Hi

sorry for my english but i'm italian.

I have a server who run with

WIN XP HOME
Abyss Web Server (Freeware) www.aprelium.com
MySql 4.0.1-alpha-nt
PHP 4.2.1

when i use mysql_connect($host,$user,$pass) or die(mysql_error()); function

he write:

Can't create TCP/IP socket (10106)

i have searched explanations on the internet but unfotunately i haven't find
out nothing.

thanks for your help.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySql password

2002-06-24 Thread Paul DuBois

At 14:58 -0400 6/24/02, Page Works Web Solutions wrote:
>Hi all,
>I have a Cobalt Raq 4 running Linux.  I've installed the .pkg file
>RaQ3-RaQ4-MySQL-3.23.37-1.pkg  I can telnet into the server and I type
>mysql, now I see that I'm in MySql, but when I type
>
>bin/mysqladmin -password and put a password in, it just goes to the next
>line with a -> and a blinking cursor.  Help?
>
>Shawn Hennessey

What's your PHP question?


mysqladmin is a shell command, you don't run it from within mysql.

>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL Update failing...

2002-06-27 Thread NIPP, SCOTT V (SBCSI)

In need of some help.  I have a PHP form page that is updating a
MySQL database that is not working.  Here is the code for the three pages
that work together for this application.  The oncall_new.php works fine to
insert new records into the database, and the oncall_log.php works fine to
display the database items.  The oncall_update.php is the one that is
failing to update the database.  I cannot find anything wrong with the code,
and I making an initial presentation of this in a couple hours.  I was
hoping another set of eyes might spot something obvious or simple.  Thanks
in advance.

 <>  <>  <> 

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] MySQL Indexing Size

2002-06-27 Thread tatang

hi all
I want to know storage required for my database.
How i can determine size required for indexing a column ?
(my column's type that indexed is varchar(15))
Thanks 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL Query problem...

2002-07-08 Thread NIPP, SCOTT V (SBCSI)

I seem to have run into another problem with a query that I am doing
exactly like the example in the MySQL documentation, I think.  The following
query is not working on my PHP page, and it is not working from a MySQL
command line either.  This looks exactly the same as an example in the MySQL
documentation though.  Thanks in advance for the help again.

SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) <= 3

This is the query that I am ultimately after:

SELECT * FROM oncall ORDER BY 'ptime' ASC WHERE TO_DAYS(NOW()) -
TO_DAYS(ptime) <= 3

I am trying to display all of the records from the past three days.
This looks like the way to go about doing this, but if there is a better way
please let me know.  (Just as more info, the 'ptime' field is a datetime
type of field.)

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mysql multiple query

2002-07-17 Thread cristian ditoiu

hello..
i have a pretty wired query to do with php/mysql .
i don't manage to do

mysql_query($qry,$connection); .
(query bellow)

so i found a quick and dirty solution.see bellow .
but it's no realy elegant .

any ideea how can i do multiple queries at once with mysql_query() ?

function copy_question($qid,$test_target) {
global $connection,$username,$password,$database;


$fp = fopen ('/tmp/copy_table_qry', 'w');

$qry="create temporary table q_temp as select * from questions;
create temporary table ans_temp as select * from answers;
set @test_id=$test_target;
set @q_id=$qid;
insert into questions select
'',@test_id,t2.q_type,t2.description,t2.dimension,t2.combination,t2.checkit
from q_temp as t2 where id=@q_id;
select @last:=LAST_INSERT_ID();
insert into answers select '',@last,score,description from ans_temp where
id_question_fk=@q_id;";

 fputs($fp,"$qry");
 fclose($fp);

$a=exec("/usr/bin/mysql -u $username -p$password $database
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] mySQL max connections

2002-07-30 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi 

I have a database thats taking a bit of a hammering - enough so that the 
number of connections spirals up and out of control.

max_connections was originally at the default of 100 - but rising above 50 or 
so meant actual throughput dropped so the db never got a chance to keep up 
(meaning manually restarting the db).  I've lowered max_connections to 40 
which at least keeps the db alive.

But, the number of connections keeps rising to and bouncing off this limit - 
and for the users that hit it a 'Too many connections' error is given.

Now, I've optimised everything as much as is humanely possible - and the only 
way out I can see so far is to have some kind of connection queue to keep 
people waiting for the 1/2 second or so until the load spike drops off (I'd 
rather have a few slow pages than errors any day).

Is there any way of doing this - I've looked at back_log (the listen() 
backlog), but that doesnt really apply.

Short of writing a 'hide-warning-wait-a-bit-and-try-again' chunk in PHP 
(sucky!) I'm stuck!

Using persistent connections doesn't stunningly help either - it only gives a 
small performance increase 

Any help appreciated, thanks.

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9RneQ5DXg6dCMBrQRAsQTAKCxNem6+NTNY/I1Wtwstil7axtykACgpUiG
c1e7on4Fu9jgYWhYNLxJAH4=
=H/Op
-END PGP SIGNATURE-


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL queries

2002-08-14 Thread Miles Thompson

George,

It is likely that your win32 system did not care about case. If you are 
using a *nix host it is case sensitive, and its installation of MySQL, by 
extension, is as well.

Try echo'ing the select statement to see what you have.

Miles

At 10:42 PM 8/14/2002 +0100, Georgie Casey wrote:
>for some reason in my mysql selecct statements in my php pages, when i
>upload them to my web server, they just return a blank record set. no errors
>or anything, just blank. i can insert fine but no select. it works fine on
>my test win32 apache/mysql
>
>--
>Regards,
>Georgie Casey
>[EMAIL PROTECTED]
>
>***
>http://www.filmfind.tv
>Online Film Production Directory
>***
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] mySQL settings

2002-08-17 Thread Jason Wong

On Sunday 18 August 2002 09:54, Georgie Casey wrote:
> rite,
> i run a web server and sell space to workers. my admin setup apache, mysql
> and php with all the settings. each customers gets one sql db with a host
> acc. the system runs ensim. but now i want one of my accounts do be able to
> access the database of another, but it wont let me. what setting do i
> change to allow me do this?

Try asking on the MySQL mailing list, or read the MySQL manual.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Experiments must be reproducible; they should all fail in the same way.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] mySQL settings

2002-08-18 Thread Joni Järvinen

Read about GRANT function in the MySQL manual.

-Joni-

--
// Joni Järvinen
// [EMAIL PROTECTED]
// http://www.reactorbox.org/~wandu

> On Sunday 18 August 2002 09:54, Georgie Casey wrote:
> > rite,
> > i run a web server and sell space to workers. my admin setup apache,
mysql
> > and php with all the settings. each customers gets one sql db with a
host
> > acc. the system runs ensim. but now i want one of my accounts do be able
to
> > access the database of another, but it wont let me. what setting do i
> > change to allow me do this?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] mySQL settings

2002-08-18 Thread MET

As Joni said you need to read about the GRANT functions in the MySQL
manual.  But basically here's what's happening.

Each person your hosting has a specific login/pass into the database.
When they login MySQL looks in the 'MySQL' database and checks the users
privileges.  By default Ensim sets up the database so that only the
website associated with a specific DB can access it.  So you'll need to
make changes to the user's account (in MySQL) with a GRANT statement
allowing him to have access to another specific database.  Make sure you
don't GRANT him access to everything, as that is naturally a massive
security hole.

~ Matthew

-Original Message-
From: Georgie Casey [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 17, 2002 9:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mySQL settings


rite,
i run a web server and sell space to workers. my admin setup apache,
mysql and php with all the settings. each customers gets one sql db with
a host acc. the system runs ensim. but now i want one of my accounts do
be able to access the database of another, but it wont let me. what
setting do i change to allow me do this?

--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL and BLOB

2002-08-21 Thread Andy

Hi there,

I am storing via PHP pictures into BLOB fields. Worked fine so far for over
200 images.
Now an error has occured with a particular picture. No error msg. Just does
not work. The wired thing is that the thumbnail does. So I guess the BLOB
field is just to small for the image.

How many kb can a blob field savin in MySQL and what do you suggest to do.

Thanx,

Andy

--
--
http://www.globosapiens.net
Worldwide Travel Community






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL/PHP

2002-08-29 Thread Beau Lebens

try a little thought...

http://www.google.com/search?sourceid=navclient&q=php+mysql+tutorial



// -Original Message-
// From: Bryan McLemore [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 30 August 2002 2:52 PM
// To: PHP LIST
// Subject: [PHP-DB] MySQL/PHP
// 
// 
// Where can I find a good manual/tutorial on how to access 
// mySQL w/PHP.  Keep in mind that I am new to both PHP and 
// mySQL, and my database theory is sketchy at best.
// 
// Thanks.
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL/PHP

2002-08-30 Thread Hutchins, Richard

Pretty basic tutorial that covers a lot of topics. If you buy the book,
there's a little more depth. On my first day working with PHP/MySQL, I had
basic pages up and running.

http://www.webmasterbase.com/article/228

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 2:54 AM
To: 'Bryan McLemore'; PHP LIST
Subject: RE: [PHP-DB] MySQL/PHP


try a little thought...

http://www.google.com/search?sourceid=navclient&q=php+mysql+tutorial



// -Original Message-
// From: Bryan McLemore [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 30 August 2002 2:52 PM
// To: PHP LIST
// Subject: [PHP-DB] MySQL/PHP
// 
// 
// Where can I find a good manual/tutorial on how to access 
// mySQL w/PHP.  Keep in mind that I am new to both PHP and 
// mySQL, and my database theory is sketchy at best.
// 
// Thanks.
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] [mysql] freeing resources

2002-09-02 Thread :B nerdy

what would happen if i do not use mysql_free_result() and mysql_close() for
my scripts.

i presuming it doesnt leak memory. if so, then why not just forget about
them, and let the automatic freeing thingie's do the work?

cheers



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] [mysql] query wierness :/

2002-09-03 Thread :B nerdy

this function doesnt work

function query($sql)
{
return mysql_query($sql, $this->mysql_link) or die("query
failed: $sql");
}

but this one does

function query($sql)
{
$mysql_result = mysql_query($sql, $this->mysql_link) or
die("query failed: $sql");
return $mysql_result;
}


why does it matter??



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] [mysql] query atomicity

2002-09-04 Thread :B nerdy

how would i go about making a few queries into a transaction - that is, if
one of them fails, the previous queries get rolled back...

cheers




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Mysql vs postgresql

2002-09-24 Thread Gavin Nouwens

Hi peoples,

The company I'm about to partner with for hosting my websites is using
postgresql for their database server.  I currently use mysql for all of
mine.

What I'm trying to find out is peoples experiences using postgresql, any
plusses or minusses, is it worth using these guys or finding another company
that will use mysql instead?

Most of the sites are being rewritten at the moment anyway so changing the
code isn't really a factor for me.

Thanks in advance,

-gav.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL Server Problem

2002-09-26 Thread Peter Rektorschek

Hi,

I don't know if I'm right at this list.

I have installed the mysql server on my debian Linux Server and it runs
perfectly if I'm connecting it from my Puretec Webspace. But if I'm
connecting from Apache with PHP4 running on localhost with the same script
it won't run but no Error are logged in /var/log/mysql.log or
/var/log/mysql/mysql.err.

Can anybody help me to fix the problem.
mfG Peter ([EMAIL PROTECTED])

http://www.reknet.de
http://www.rektorschek.de
http://www.petershomepage.de
http://www.klo-papier.de ;-)





[PHP-DB] MySQL crypt test...

2002-10-23 Thread NIPP, SCOTT V (SBCSI)
I am having trouble with a "canned" calendar application and I think
that maybe the problem is the crypt function.  Does anyone know of a good
way to test the crypt function?  I need to figure out somehow if this is the
source of the problem or not.  Thanks.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL password protection?

2002-11-06 Thread William Trappeniers
Hi all

I was wondering if it is possible to protect my password to the MySQL-server
from being in a PHP-script.  Now I can't do that, so everybody who gets to
see my php-sourcecode also can see my (not protected/not encrypted)
password.
How can I change this?

Thanks,

William

---
William Trappeniers
mail at: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySql Update.

2002-11-12 Thread Adam Voigt
$query = "UPDATE tablename SET ";
foreach($_POST AS $key => $value)
$query .= "$key = '$value',";
$query[strlen($query)-1] = "";
$query .= " WHERE id = '$_GET[id]';

Or something?

On Tue, 2002-11-12 at 13:58, David Rice wrote:
> 
> 
> Making an update query that adapts to the number of fields that are to be 
> updated
> 
> Is there anyway to do like a for loop to create the values part of the query 
> then combine it with the first part of the string.
> 
> something like what i have below... although something that works correctly 
> as this doesn't.
> ==
> 
> $table is the table name
> $num_headers is the number of headers (fieldnames) for that table
> $table_headers is an array with the names of the headers
> $values is an array with the names of the input boxes on the previous page
> 
> ==
> $query1 = "UPDATE ".$table." SET " ;
> 
> $query2 = ( for ($x=0; $x <=$num_headers; $x++){
>". $table_headers[$x] . "=" . $values[$x] . " , "
>}) ;
> 
> $query = $query1.$query2 ;
> 
> $result = mysql_query ($query) ;
> etc...
> 
> 
> 
> _
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] MySql Update.

2002-11-12 Thread Marco Tabini
How about:

function do_query ($table, $fields, $where)
{
$sql = 'update ' . $table . ' Set ';
foreach ($fields as $k=>$v)
$sql = $k . ' = \'' . $v . '\',';
return mysql_query ($sql);
}

Not sure if it adapts 100% to your case but you can probably fix it
up...


Marco


-- 

php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

--- Begin Message ---


Making an update query that adapts to the number of fields that are to be 
updated

Is there anyway to do like a for loop to create the values part of the query 
then combine it with the first part of the string.

something like what i have below... although something that works correctly 
as this doesn't.
==

$table is the table name
$num_headers is the number of headers (fieldnames) for that table
$table_headers is an array with the names of the headers
$values is an array with the names of the input boxes on the previous page

==
$query1 = "UPDATE ".$table." SET " ;

$query2 = ( for ($x=0; $x <=$num_headers; $x++){
  ". $table_headers[$x] . "=" . $values[$x] . " , "
  }) ;

$query = $query1.$query2 ;

$result = mysql_query ($query) ;
etc...



_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySql security

2002-11-19 Thread Joakim Andersson
> Hi,
> 
> Since i dont know any mysql group, i will try here - it is 
> anyway related to
> php.
> When i want to make php/mysql application i have mysql on the 
> server and i
> connect to it with mysql_pconnect("localhost","root","") and it works.
> I assume that any user or hacker could connect to mysql 
> database like this.
> So, i want to create my database and i want to limit access 
> to this database
> for some usernames and passwords. I know MSSQL or Interbase 
> can do it - but
> how i do this in mysql.
> If this is offtopic can someone point me to any mysql newsgroup.

I would say this is very offtopic, but this query should do the trick:
GRANT select, update, insert ON your_db_name.* TO
your_username@localhost IDENTIFIED BY 'your_password'
Take a look in the MySQL manual for more details on GRANT.

To set a password for root you can use the mysqladmin command:
mysqladmin -u root password your_new_pwd
Note that the word password here really is the word password!
Or you could run this query on the mysql db.
SET PASSWORD FOR root@localhost=PASSWORD('your_new_pwd');

> Other question is: if i need to make application which uses 
> credit cards,
> how can i increase security for it. I have heard about https 
> protocol, but
> dont know much about it. Any link would be appreciated.

You have to look in your webserver's manual for this.

Regards
Joakim
-
This message contains information that may be privileged or confidential and
is the property of Cyber Com and may be exempt from disclosure under
applicable law. It is intended only for the person to whom it is addressed.
If you are not the intended recipient, you are not authorized to read,
print, retain, copy, disseminate, distribute, or use this message or any
part thereof. If you receive this message in error, please notify the sender
immediately and delete all copies of this message.
This agreement shall be governed by the law where the sender has its place
of business. 
Any attachment(s) to this e-mail has been checked for viruses, but please
rely on your own virus-checker and procedures.
-

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySql security

2002-11-19 Thread Radovan Radic
> > how i do this in mysql.
> > If this is offtopic can someone point me to any mysql newsgroup.
>
> I would say this is very offtopic, but this query should do the trick:
> GRANT select, update, insert ON your_db_name.* TO
> your_username@localhost IDENTIFIED BY 'your_password'
> Take a look in the MySQL manual for more details on GRANT.
>

Thank you for the answers, i will explore little bit more about this.

Radovan



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Michael Hazelden
Maybe I'm missing something - but the MySQL statement looks right ...

How are you displaying the results?

-Original Message-
From: Griffiths, Daniel [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 16:37
To: PHP List
Subject: [PHP-DB] MySQL Problem


Hi,

I have a problem with an MySQL statement that is driving me mad, I'm using
php to connect to the database. this  is it : -

SELECT LINE,SUM(IF(MONTH=2,WB.TEU,0)) AS '2' ,SUM(IF(MONTH=3,WB.TEU,0)) AS
'3' ,SUM(IF(MONTH=4,WB.TEU,0)) AS '4' ,SUM(IF(MONTH=5,WB.TEU,0)) AS '5'
,SUM(IF(MONTH=6,WB.TEU,0)) AS '6' ,SUM(IF(MONTH BETWEEN 2 AND 6,WB.TEU,0))
AS '2 TO 6' FROM WB WHERE EAST_PORT='A' AND WEST_PORT='B' GROUP BY LINE

what I want to produce with this is this : -

LINE2   3   4   5   6   2 TO 6
A   133511181260139512766384
B   432 469 451 480 555 2387
C   504 554 575 517 764 2914

however what I get is this : -

LINE2   3   4   5   6   2 TO 6
A   111812601395127663846384
B   469 451 480 555 23872387
C   554 575 517 764 29142914

the last column of figures (2 TO 6) has been replicated under 6 and pushed
the values that were in 6 into 5 and so on!

I can not see for the life of me why this should or could be happening,
especially as the equivalent code in MS Access : - 

SELECT LINE, Sum(IIf(MONTH=2,TEU,0)) AS ['2'], Sum(IIf(MONTH=3,TEU,0)) AS
['3'], Sum(IIf(MONTH=4,TEU,0)) AS ['4'], Sum(IIf(MONTH=5,TEU,0)) AS ['5'],
Sum(IIf(MONTH=6,TEU,0)) AS ['6'],
SUM(IIF(MONTH BETWEEN 2 AND 6,TEU,0)) AS 'FEB TO JUNE' ,
SUM(IIF(MONTH BETWEEN 1 AND 6,TEU,0)) AS 'YTD' 
FROM DUMP
WHERE (((DUMP.[EAST PORT])='HONG KONG') AND ((DUMP.[WEST PORT])='UK'))
GROUP BY DUMP.LINE; 

gives the correct results.

If anyone has any idea of what is going on here please let me know, I'm
hoping its something simple I'm missing..

Thanks

Dan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Griffiths, Daniel
the statement runs without errors, its just the output thats wrong (see the two 
tables) I'm displaying the results by doing a simple dump of the query, through my own 
code and have also tried through phpMyAdmin.

-Original Message-
From: Michael Hazelden [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 16:41
To: Griffiths, Daniel; PHP List
Subject: RE: [PHP-DB] MySQL Problem


Maybe I'm missing something - but the MySQL statement looks right ...

How are you displaying the results?

-Original Message-
From: Griffiths, Daniel [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 16:37
To: PHP List
Subject: [PHP-DB] MySQL Problem


Hi,

I have a problem with an MySQL statement that is driving me mad, I'm using
php to connect to the database. this  is it : -

SELECT LINE,SUM(IF(MONTH=2,WB.TEU,0)) AS '2' ,SUM(IF(MONTH=3,WB.TEU,0)) AS
'3' ,SUM(IF(MONTH=4,WB.TEU,0)) AS '4' ,SUM(IF(MONTH=5,WB.TEU,0)) AS '5'
,SUM(IF(MONTH=6,WB.TEU,0)) AS '6' ,SUM(IF(MONTH BETWEEN 2 AND 6,WB.TEU,0))
AS '2 TO 6' FROM WB WHERE EAST_PORT='A' AND WEST_PORT='B' GROUP BY LINE

what I want to produce with this is this : -

LINE2   3   4   5   6   2 TO 6
A   133511181260139512766384
B   432 469 451 480 555 2387
C   504 554 575 517 764 2914

however what I get is this : -

LINE2   3   4   5   6   2 TO 6
A   111812601395127663846384
B   469 451 480 555 23872387
C   554 575 517 764 29142914

the last column of figures (2 TO 6) has been replicated under 6 and pushed
the values that were in 6 into 5 and so on!

I can not see for the life of me why this should or could be happening,
especially as the equivalent code in MS Access : - 

SELECT LINE, Sum(IIf(MONTH=2,TEU,0)) AS ['2'], Sum(IIf(MONTH=3,TEU,0)) AS
['3'], Sum(IIf(MONTH=4,TEU,0)) AS ['4'], Sum(IIf(MONTH=5,TEU,0)) AS ['5'],
Sum(IIf(MONTH=6,TEU,0)) AS ['6'],
SUM(IIF(MONTH BETWEEN 2 AND 6,TEU,0)) AS 'FEB TO JUNE' ,
SUM(IIF(MONTH BETWEEN 1 AND 6,TEU,0)) AS 'YTD' 
FROM DUMP
WHERE (((DUMP.[EAST PORT])='HONG KONG') AND ((DUMP.[WEST PORT])='UK'))
GROUP BY DUMP.LINE; 

gives the correct results.

If anyone has any idea of what is going on here please let me know, I'm
hoping its something simple I'm missing..

Thanks

Dan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Problem

2002-11-21 Thread Jason Wong
On Friday 22 November 2002 00:46, Griffiths, Daniel wrote:
> the statement runs without errors, its just the output thats wrong (see the
> two tables) I'm displaying the results by doing a simple dump of the query,
> through my own code and have also tried through phpMyAdmin.

Not sure if this could be the problem -- where are you getting MONTH from and 
does it start at 0 or 1?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
I saw Lassie.  It took me four shows to figure out why the hairy kid never
spoke. I mean, he could roll over and all that, but did that deserve a series?
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Jason Vincent
Still think we need to see the PHP code before determining that it is an SQL
problem.

Regards,

J


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, November 21, 2002 11:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Problem


On Friday 22 November 2002 00:46, Griffiths, Daniel wrote:
> the statement runs without errors, its just the output thats wrong 
> (see the two tables) I'm displaying the results by doing a simple dump 
> of the query, through my own code and have also tried through 
> phpMyAdmin.

Not sure if this could be the problem -- where are you getting MONTH from
and 
does it start at 0 or 1?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
I saw Lassie.  It took me four shows to figure out why the hairy kid never
spoke. I mean, he could roll over and all that, but did that deserve a
series? */


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Griffiths, Daniel
the month starts at 1, at the moment I'm just hard coding the month into the statment.

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 16:55
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Problem


On Friday 22 November 2002 00:46, Griffiths, Daniel wrote:
> the statement runs without errors, its just the output thats wrong (see the
> two tables) I'm displaying the results by doing a simple dump of the query,
> through my own code and have also tried through phpMyAdmin.

Not sure if this could be the problem -- where are you getting MONTH from and 
does it start at 0 or 1?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
I saw Lassie.  It took me four shows to figure out why the hairy kid never
spoke. I mean, he could roll over and all that, but did that deserve a series?
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL connectiviy

2002-11-22 Thread Pedro M. S. Oliveira
Hi Jeremy,
Probably you don't have all of php installed; you can pick it up in
php.net and install the full php libs.
Or in your php ini file, the php lib path can be incorrect, well these
are just thoughts as I don't use red hat for some time (SuSE Forever).
Hope you figure it out,
Pedro


-Original Message-
From: Jeremy Wood [mailto:[EMAIL PROTECTED]] 
Sent: sexta-feira, 22 de Novembro de 2002 18:35
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL connectiviy

Hello all,
I'm new to PHP and would like to start using mySQL (or postgresql) but I
keep having one problem. 
In a php file i have a simple call to the function
mysql_connect()

but i constantly get the error
Fatal error: Call to undefined function: mysql_connect() 

MySQL support was installed with
--with-mysql=shared,/usr' 
This is the redhat 8.0 default. I guess it just can't find the function
library.

Any pointers any one could give would be really appreciated.
Thanks,
Jeremy Wood



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL connectiviy

2002-11-22 Thread Jason Wong
On Saturday 23 November 2002 02:34, Jeremy Wood wrote:
> Hello all,
> I'm new to PHP and would like to start using mySQL (or postgresql) but I
> keep having one problem. In a php file i have a simple call to the function
> mysql_connect()
>
> but i constantly get the error
> Fatal error: Call to undefined function: mysql_connect()
>
> MySQL support was installed with
> --with-mysql=shared,/usr'
> This is the redhat 8.0 default. I guess it just can't find the function
> library.
>
> Any pointers any one could give would be really appreciated.

Have you installed the "php-mysql*.rpm" ?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Computer programs expand so as to fill the core available.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL connectiviy

2002-11-22 Thread Jeremy Wood
No, I was unable to find a new version of it. Is there a version for php 4.2
?



Jeremy



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL connectiviy

2002-11-22 Thread Jeremy Wood

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 22, 2002 1:27 PM
Subject: Re: [PHP-DB] MySQL connectiviy


> On Saturday 23 November 2002 02:34, Jeremy Wood wrote:
> > Hello all,
> > I'm new to PHP and would like to start using mySQL (or postgresql) but I
> > keep having one problem. In a php file i have a simple call to the
function
> > mysql_connect()
> >
> > but i constantly get the error
> > Fatal error: Call to undefined function: mysql_connect()
> >
> > MySQL support was installed with
> > --with-mysql=shared,/usr'
> > This is the redhat 8.0 default. I guess it just can't find the function
> > library.
> >
> > Any pointers any one could give would be really appreciated.
>
> Have you installed the "php-mysql*.rpm" ?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
>
> /*
> Computer programs expand so as to fill the core available.
> */
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL connectiviy

2002-11-22 Thread Jeremy Wood
Ok i found that package and I also got pgsql working so Ill just use that if
I dont ahve any success. Thanks for all the help.

Jeremy


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] mysql problem

2002-11-28 Thread Peter Lovatt
Hi

you need quotes around the values

mysql_query("insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
('$quotetype','$referer','$browser','$remoteaddress','$currentdtstring')",$d
b);

HTH

Peter
---
Excellence in internet and open source software
---
Sunmaia
Birmingham
UK
www.sunmaia.net
tel. 0121-242-1473
International +44-121-242-1473
---

-Original Message-
From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2002 22:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql problem


Hello all!  I am new to php and I am trying to update a mySQL table using
php v4.2.3 for Windows.  I am using the command:

mysql_query("insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
($quotetype,$referer,$browser,$remoteaddress,$currentdtstring)",$db);

I have read the documentation and found some notes on the topic but none
seemed to solve my problem.  I have tried other variations of the command
such as inserting a semicolon at the end of the insert statement before the
closing double quotes.  All variables are defined and all columns are
actually columns in the table ... I have checked all of this.  I have also
returned the result to a variable and echoed it to the screen ... the result
printed is "Resource id #2".

This is driving me crazy as I know it must be something quite simple that I
am overlooking.  Any help is greatly appreciated!  TIA

Bill


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] mysql problem

2002-11-28 Thread John W. Holmes
So what's the problem? The data doesn't appear in the table? Did you try
to see if mysql_error() had anything in it after your query?

---John Holmes...

> -Original Message-
> From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 28, 2002 5:56 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] mysql problem
> 
> Hello all!  I am new to php and I am trying to update a mySQL table
using
> php v4.2.3 for Windows.  I am using the command:
> 
> mysql_query("insert into tblquotehits
> (qoption,referer,browser,remoteaddr,dt) values
> ($quotetype,$referer,$browser,$remoteaddress,$currentdtstring)",$db);
> 
> I have read the documentation and found some notes on the topic but
none
> seemed to solve my problem.  I have tried other variations of the
command
> such as inserting a semicolon at the end of the insert statement
before
> the
> closing double quotes.  All variables are defined and all columns are
> actually columns in the table ... I have checked all of this.  I have
also
> returned the result to a variable and echoed it to the screen ... the
> result
> printed is "Resource id #2".
> 
> This is driving me crazy as I know it must be something quite simple
that
> I
> am overlooking.  Any help is greatly appreciated!  TIA
> 
> Bill
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] mysql - enum

2002-12-02 Thread Ignatius Reilly
DESCRIBE tbl_name col_name 

Ignatius

- Original Message - 
From: "Bastian Vogt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 1:41 PM
Subject: [PHP-DB] mysql - enum


> Hi,
> 
> is it possible to get all possible values of an enum-field from a
> mysql-table in php?
> The values might be changed in the database. Now I've got an
> select-field in my php-app where the user can select each value of the
> enum-field for a new record befor saving...
> 
> Thanks for any reply,
> Bastian
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] mysql - enum

2002-12-02 Thread Ruth Zhai
This is what I use:

SHOW COLUMNS FROM table LIKE "field"

I use the query result for a select field in HTML table.
Ruth
- Original Message - 
From: "Bastian Vogt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 11:41 PM
Subject: [PHP-DB] mysql - enum


> Hi,
> 
> is it possible to get all possible values of an enum-field from a
> mysql-table in php?
> The values might be changed in the database. Now I've got an
> select-field in my php-app where the user can select each value of the
> enum-field for a new record befor saving...
> 
> Thanks for any reply,
> Bastian
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Array

2002-12-05 Thread Ryan Jameson (USA)
while ($ar = mysql_fetch_array($rs))
  echo "". $ar['field1']."".$ar['field2']."";


Make sense?

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Array


Hello,

I am pulling one column out of a MySQL table in an array.  I want to place
each element into a HTML table 4 rows across.  I am currently doing this
with the mysql_fetch_array() function. How can I pull out 4 array elements
in one pass through a while loop?

Thanks

Art Chevalier



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Array

2002-12-05 Thread Art Chevalier
Yes that makes sense, but it is pretty much the same thing I was doing and
it's producing the same results.  Its basically putting the first element in
all 4 table cells.  The thing is...I am only selecting from one field.  Im
trying to get the 4 elements of the column with each pass.  So in essence I
am trying to get the pointer to move down the array 4 positions within one
pass through the loop.  If I had any kind of logicl skills I probably could
get it:)

Art

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
while ($ar = mysql_fetch_array($rs))
  echo "". $ar['field1']."".$ar['field2']."";


Make sense?

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Array


Hello,

I am pulling one column out of a MySQL table in an array.  I want to place
each element into a HTML table 4 rows across.  I am currently doing this
with the mysql_fetch_array() function. How can I pull out 4 array elements
in one pass through a while loop?

Thanks

Art Chevalier



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Array

2002-12-05 Thread Aaron Wolski
Why don't you post the actual data you are pulling FROM the Db.. then
show HOW you want it formatted.

Might be better for us to give you a solution or something.

Aaron

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]] 
Sent: December 5, 2002 3:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Array

Yes that makes sense, but it is pretty much the same thing I was doing
and
it's producing the same results.  Its basically putting the first
element in
all 4 table cells.  The thing is...I am only selecting from one field.
Im
trying to get the 4 elements of the column with each pass.  So in
essence I
am trying to get the pointer to move down the array 4 positions within
one
pass through the loop.  If I had any kind of logicl skills I probably
could
get it:)

Art

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
while ($ar = mysql_fetch_array($rs))
  echo "". $ar['field1']."".$ar['field2']."";


Make sense?

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Array


Hello,

I am pulling one column out of a MySQL table in an array.  I want to
place
each element into a HTML table 4 rows across.  I am currently doing this
with the mysql_fetch_array() function. How can I pull out 4 array
elements
in one pass through a while loop?

Thanks

Art Chevalier



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Array

2002-12-05 Thread 1LT John W. Holmes
I think he meant that he is only pulling one column, i.e. "field1" with each
mysql_fetch_array and he wants that in four columns.

$c = 1;
echo "";
while($ar = mysql_fetch_array($result))
{
  echo "{$ar['field1']}";
  if(($c % 4) == 0) { echo ""; }
}

You'll have to account for incomplete rows and clean up the output, but
hopefully that gives you an idea.

---John Holmes...

- Original Message -
From: "Ryan Jameson (USA)" <[EMAIL PROTECTED]>
To: "Art Chevalier" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 3:05 PM
Subject: RE: [PHP-DB] MySQL Array


while ($ar = mysql_fetch_array($rs))
  echo "". $ar['field1']."".$ar['field2']."";


Make sense?

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Array


Hello,

I am pulling one column out of a MySQL table in an array.  I want to place
each element into a HTML table 4 rows across.  I am currently doing this
with the mysql_fetch_array() function. How can I pull out 4 array elements
in one pass through a while loop?

Thanks

Art Chevalier



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Array

2002-12-06 Thread Chevalier, Arthur
You are right about my query.  I am only pulling down one column. 

As you guys can probably tell I am pretty inexperienced with this.  I tried
what you said and still got the same results.

Here are snippets of my code and maybe this will depict what I am doing
wrong:

After creating the connection:

$query = "select server_name from servers where midtier = '$server'";
$dbResult = mysql_query($query,$dblink);  

$c = 1; 
print("");
while($row = mysql_fetch_array($dbResult))
{
print("{$row['server_name']}");
if(($c % 4) == 0) 
{ 
print(""); 
}
}



-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 05, 2002 3:26 PM
To: Ryan Jameson (USA); Art Chevalier; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Array

I think he meant that he is only pulling one column, i.e. "field1" with each
mysql_fetch_array and he wants that in four columns.

$c = 1;
echo "";
while($ar = mysql_fetch_array($result))
{
  echo "{$ar['field1']}";
  if(($c % 4) == 0) { echo ""; }
}

You'll have to account for incomplete rows and clean up the output, but
hopefully that gives you an idea.

---John Holmes...

- Original Message -
From: "Ryan Jameson (USA)" <[EMAIL PROTECTED]>
To: "Art Chevalier" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 3:05 PM
Subject: RE: [PHP-DB] MySQL Array


while ($ar = mysql_fetch_array($rs))
  echo "". $ar['field1']."".$ar['field2']."";


Make sense?

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Array


Hello,

I am pulling one column out of a MySQL table in an array.  I want to place
each element into a HTML table 4 rows across.  I am currently doing this
with the mysql_fetch_array() function. How can I pull out 4 array elements
in one pass through a while loop?

Thanks

Art Chevalier



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Array

2002-12-06 Thread Mark
It's not incrementing $c. Start out with $c=0;, then Add $c++; after
the while line (not after the whole while statement).

Like this:
 $c = 0;
 print("");
 while($row = mysql_fetch_array($dbResult))
$c++;
{
print("{$row['server_name']}");
if(($c % 4) == 0) 
{ 
print(""); 
}
}

You'll also need a print("") at the end, but I assume
you knew that...

--- "Chevalier, Arthur" <[EMAIL PROTECTED]> wrote:
> You are right about my query.  I am only pulling down one column. 
> 
> As you guys can probably tell I am pretty inexperienced with this. 
> I tried
> what you said and still got the same results.
> 
> Here are snippets of my code and maybe this will depict what I am
> doing
> wrong:
> 
> After creating the connection:
> 
> $query = "select server_name from servers where midtier =
> '$server'";
> $dbResult = mysql_query($query,$dblink);  
> 
> $c = 1;   
> print("");
> while($row = mysql_fetch_array($dbResult))
>   {
>   print("{$row['server_name']}");
>   if(($c % 4) == 0) 
>   { 
>   print(""); 
>   }
>   }
> 
> 
> 
> -Original Message-
> From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, December 05, 2002 3:26 PM
> To: Ryan Jameson (USA); Art Chevalier; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] MySQL Array
> 
> I think he meant that he is only pulling one column, i.e. "field1"
> with each
> mysql_fetch_array and he wants that in four columns.
> 
> $c = 1;
> echo "";
> while($ar = mysql_fetch_array($result))
> {
>   echo "{$ar['field1']}";
>   if(($c % 4) == 0) { echo ""; }
> }
> 
> You'll have to account for incomplete rows and clean up the output,
> but
> hopefully that gives you an idea.
> 
> ---John Holmes...
> 
> - Original Message -
> From: "Ryan Jameson (USA)" <[EMAIL PROTECTED]>
> To: "Art Chevalier" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Thursday, December 05, 2002 3:05 PM
> Subject: RE: [PHP-DB] MySQL Array
> 
> 
> while ($ar = mysql_fetch_array($rs))
>   echo "".
> $ar['field1']."".$ar['field2']."";
> 
> 
> Make sense?
> 
> -Original Message-
> From: Art Chevalier [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 05, 2002 12:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] MySQL Array
> 
> 
> Hello,
> 
> I am pulling one column out of a MySQL table in an array.  I want
> to place
> each element into a HTML table 4 rows across.  I am currently doing
> this
> with the mysql_fetch_array() function. How can I pull out 4 array
> elements
> in one pass through a while loop?
> 
> Thanks
> 
> Art Chevalier
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Array

2002-12-06 Thread Art Chevalier
Mark,

That was just about it.  Once I moved the $c incrementor inside the loop it
worked perfectly.

$c = 0;
print("");
 while($row = mysql_fetch_array($dbResult))
{
 $c++;
print("{$row['server_name']}");
 if(($c % 4) == 0)
   {
   print("");
   }
}

I appreciate you all helping a me (a rookie) through this problem.

Art


"Mark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It's not incrementing $c. Start out with $c=0;, then Add $c++; after
> the while line (not after the whole while statement).
>
> Like this:
>  $c = 0;
>  print("");
>  while($row = mysql_fetch_array($dbResult))
> $c++;
>   {
>   print("{$row['server_name']}");
>  if(($c % 4) == 0)
>   {
>   print("");
> }
>   }
>
> You'll also need a print("") at the end, but I assume
> you knew that...
>
> --- "Chevalier, Arthur" <[EMAIL PROTECTED]> wrote:
> > You are right about my query.  I am only pulling down one column.
> >
> > As you guys can probably tell I am pretty inexperienced with this.
> > I tried
> > what you said and still got the same results.
> >
> > Here are snippets of my code and maybe this will depict what I am
> > doing
> > wrong:
> >
> > After creating the connection:
> >
> > $query = "select server_name from servers where midtier =
> > '$server'";
> > $dbResult = mysql_query($query,$dblink);
> >
> > $c = 1;
> > print("");
> > while($row = mysql_fetch_array($dbResult))
> > {
> > print("{$row['server_name']}");
> > if(($c % 4) == 0)
> > {
> > print("");
> > }
> > }
> >
> >
> >
> > -Original Message-
> > From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, December 05, 2002 3:26 PM
> > To: Ryan Jameson (USA); Art Chevalier; [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] MySQL Array
> >
> > I think he meant that he is only pulling one column, i.e. "field1"
> > with each
> > mysql_fetch_array and he wants that in four columns.
> >
> > $c = 1;
> > echo "";
> > while($ar = mysql_fetch_array($result))
> > {
> >   echo "{$ar['field1']}";
> >   if(($c % 4) == 0) { echo ""; }
> > }
> >
> > You'll have to account for incomplete rows and clean up the output,
> > but
> > hopefully that gives you an idea.
> >
> > ---John Holmes...
> >
> > - Original Message -
> > From: "Ryan Jameson (USA)" <[EMAIL PROTECTED]>
> > To: "Art Chevalier" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Thursday, December 05, 2002 3:05 PM
> > Subject: RE: [PHP-DB] MySQL Array
> >
> >
> > while ($ar = mysql_fetch_array($rs))
> >   echo "".
> > $ar['field1']."".$ar['field2']."";
> >
> >
> > Make sense?
> >
> > -Original Message-
> > From: Art Chevalier [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, December 05, 2002 12:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] MySQL Array
> >
> >
> > Hello,
> >
> > I am pulling one column out of a MySQL table in an array.  I want
> > to place
> > each element into a HTML table 4 rows across.  I am currently doing
> > this
> > with the mysql_fetch_array() function. How can I pull out 4 array
> > elements
> > in one pass through a while loop?
> >
> > Thanks
> >
> > Art Chevalier
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> =
> Mark Weinstock
> [EMAIL PROTECTED]
> ***
> You can't demand something as a "right" unless you are willing to fight to
death to defend everyone else's right to the same thing.
> -Stolen from the now-defunct Randy's Random mailing list.
> ***
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Array

2002-12-06 Thread Antonio Bernabei
Hi,

I want to insert the upper case of the strings written in the forn, so I put
on the php file called these lines

$NOME=strtoupper($nome);

mysql_query ("INSERT INTO anagrafe (codice,nome, cognome, codicefiscale)

VALUES
('strtoupper($codicefiscale)','$NOME','strtoupper($cognome)','strtoupper($co
dicefiscale)', ...

but if $codice if for example abc in field codice I don't get ABC but
uppercase(abc)
while if $nome is mario in the filed nome I get MARIO

Can I avoid to write extra lines for the conversion?
Thanks
Antonio




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Array

2002-12-06 Thread Ignatius Reilly
Try:

$query = "INSERT INTO anagrafe (codice,nome, cognome, codicefiscale)
VALUES ('"
.strtoupper($codicefiscale)
."','{$NOME}','"
.strtoupper($cognome)
."','"
.strtoupper($co
dicefiscale)
."', etc"

then
mysql_query ( $query ) ;

Ignatius

- Original Message -
From: "Antonio Bernabei" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 7:12 PM
Subject: Re: [PHP-DB] MySQL Array


> Hi,
>
> I want to insert the upper case of the strings written in the forn, so I
put
> on the php file called these lines
>
> $NOME=strtoupper($nome);
>
> mysql_query ("INSERT INTO anagrafe (codice,nome, cognome, codicefiscale)
>
> VALUES
>
('strtoupper($codicefiscale)','$NOME','strtoupper($cognome)','strtoupper($co
> dicefiscale)', ...
>
> but if $codice if for example abc in field codice I don't get ABC but
> uppercase(abc)
> while if $nome is mario in the filed nome I get MARIO
>
> Can I avoid to write extra lines for the conversion?
> Thanks
> Antonio
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL: FULLTEXT Index

2002-12-09 Thread John Taylor-Johnston
Does anyone know what the maximum is for a FULTEXT Index in MySQL?

John


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL query... count?

2004-03-01 Thread Tristan . Pretty
This problem pertains to a system that records all downloads from our 
site:

I have a field in my DB, that states which business unit owns the download 
that was recorded...
What I need to do for a new report, is say how many downloads were 
recorded for each Business unit?

I can select the Business units using Distinct, but hhow can I then count 
them?
I've tried:
SELECT DISTINCT(bu)buname, COUNT(buname)bucount FROM $table_name

But it doesn't work.. am I being dumb on this cold Monday morning?

Tris...


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MySql PHP API

2004-03-01 Thread Mike Ni
Hey everyone,


Does anyone outhere is running Apache/Linux/PHP/Mysql?

I am having hard time with "MYSQL PHP API". Apache/PHP
simply would not recognize any cmysql function call
such as "mysql_connect".

I have recompile the php with mysql extension and th
problem continue tobe there. 

I run the "phpifo" and it work.
In smuuary:

* Beside Mysql, PHP seems to be working including
phpino
* According to phpinfo( ), it suuport mysql. Yet,
wouldn't recognize the functin call


Plese let me know if you have any thought.

Thanks!

__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Mysql MaxDB Support?

2004-03-11 Thread Carolyn Longfoot
Does PHP natively support MaxDB? I have not seen any mention of it in the
manual anywhere. If not and anybody uses ODBC could you kindly post the
configuration?

Cheers!

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL Logging

2004-03-13 Thread Richard Bewley
Hi,

You could do something like tail -n25 /var/log/mysqld.log | mail -s
"Database Logs" [EMAIL PROTECTED], and run it in cron.  For logging, if you
want to log queries, you would use mysqld --log=/var/log/queries.log, but
I'm not sure this is the type of logging you're looking for.

What might be a better idea, is do the mysqldump, dump everything to a text
file, then, at the end of the text file, append the date so that it looks
like:

INSERT INTO
03/13/2004

Then, just tail the last 10 lines of the text file, and you can verify a
couple lines of data as well as the current date.  Worse case, you have to
restore that data, you just have to remove the date.

Hope this helps,
Richard

-Original Message-
From: Jai Jones [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 13, 2004 8:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Logging

Hi,

Sorry if this the wrong list, I am a little confused on how to get MySQL 
logging working, I am hoping some PHP users are doing something like this.

I am backing up my MySQL data using a shell script and mysqldump. I would 
like to be able to send an email notification to myself to know that the 
dump worked.

My idea is tac'ing or tail'ing the last few entries of a mysql (or 
mysqldump?) log and pipping it to email. Does this sound like a good idea?

It appears my server is not logging by default, how do I enable a log that 
would store this info, or am I looking at this the wrong way.

All help is kindly appreciated.

Thankyou :)
JJ

_
MSN Messenger: instale grátis e converse com seus amigos. 
http://messenger.msn.com.br

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySql query

2004-03-17 Thread Bruno Ferreira
Matt Matijevich wrote:

This is probably a question for for a mysql list but I figured someone
out here knows the answer.
[snip]
SELECT * FROM sometable WHERE 1
 

SELECT * FROM sometable

Just that :) (do I hear you slapping your forehead? :)

Bruno Ferreira.

---
[This E-mail scanned for viruses by Declude Virus]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySql query

2004-03-17 Thread Matt Matijevich

SELECT * FROM sometable


Just that :) (do I hear you slapping your forehead? :)

Bruno Ferreira.


Thanks for the answers guys.  My problem was I am a mysql novice and
there was a bunch of existing queries that use the "WHERE 1" syntax.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySql query

2004-03-17 Thread Adam Voigt
Yes, where evaluates to true.


On Wed, 2004-03-17 at 12:03, Matt Matijevich wrote:
> This is probably a question for for a mysql list but I figured someone
> out here knows the answer.
> 
> I am working with an existing mysql application and there is a bunch of
> queries that are formatted something like this:
> 
> SELECT * FROM sometable WHERE 1
> 
> does "WHERE 1" just return every row?
> 
> thanks in advance.
-- 

Adam Voigt
[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySql query

2004-03-17 Thread Ryan Jameson (USA)
One reason that my queries will look like what you described is that
later I append more conditions. The where 1 allows me to tack them all
on with AND or OR instead of having to put the where on later and decide
things like if I need to put AND or OR or WHERE or whatever... The WHERE
1 keeps it simple 

<>< Ryan 

-Original Message-
From: Adam Voigt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 17, 2004 10:15 AM
To: Matt Matijevich
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySql query

Yes, where evaluates to true.


On Wed, 2004-03-17 at 12:03, Matt Matijevich wrote:
> This is probably a question for for a mysql list but I figured someone

> out here knows the answer.
> 
> I am working with an existing mysql application and there is a bunch 
> of queries that are formatted something like this:
> 
> SELECT * FROM sometable WHERE 1
> 
> does "WHERE 1" just return every row?
> 
> thanks in advance.
-- 

Adam Voigt
[EMAIL PROTECTED]

--
PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] mySQL Parse Error

2004-03-22 Thread Nadim Attari
Hi,

I have a table:

CREATE TABLE `cashmire` (`id` smallint(3) unsigned NOT NULL auto_increment,
`itemcode` varchar(25) NOT NULL default '', `collection` char(2) NOT NULL
default 'cl',
`promotion` char(1) default 'n', `bestSeller` char(1) default 'n',
`newArrival` char(1) default 'n', `size` varchar(15) default NULL, `colour`
varchar(30) default NULL,
`image` varchar(7) default NULL, `currency` char(3) default 'MRS', `price`
mediumint(8) unsigned NOT NULL default '0', `description` text, `purchased`
smallint(3) unsigned default NULL,
PRIMARY KEY (`id`), UNIQUE KEY `itemcode` (`itemcode`), ) TYPE=MyISAM;

When i run this SQL:

insert into cashmire ('itemcode', 'collection', 'promotion', 'bestSeller',
'newArrival', 'size', 'color', 'image', 'currency', 'price', 'description',
'purchased') values ('31474', 'cl', 'n', 'n', 'y', 'S-M-L-XL', 'AQ-BL-EC',
'', 'MRS', '8400', 'Long sleeve chunky roll neck cardigan (12 ply) with high
ribbed welt and turn-back cuffs, authentic coconut buttons', '0')

I get:

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 ''itemcode',
'collection', 'promotion', 'bestSeller', 'newArriva

I can't understand... tried googling but still no answer!

Can someone help me please,

regards,

nadim attari

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Mysql Foreign Keys

2004-04-20 Thread Uzi Klein
Does anybody know of a good tutorial of using foreign keys in MySQL InnoDB
tables?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] mysql went away

2004-05-12 Thread Bill Green
HI. I've been using mySQL 4.0.13, php4.3.4, and phpMyAdmin2.5.5 on Mac 
OS 10.3.3 as a learning/testing/development environment for a couple of 
months now - no problems, works great.

I've created more than a few mySQL databases and tables, but yesterday 
I created a database, a table, and LOAD DATA from within phpMyAdmin. 
Successfully. I looked at the data and all was fine. Logged out and 
went away for a while. Came back and phpMyAdmin would not show me my 
databases in the left frame, and I could not launch a query window. I 
could see runtime information, system vars, processes, and even 
privileges.

I tried logging in to mySQL through the terminal, and I can run simple 
commands and connect OK, but any commands to show databases or tables 
will hang the terminal. Through the command line client I can run 
simple commands, but no commands to view or affect databases or tables.

I can run php scripts - connect to databases, retrieve and even 
insert/update data, but I cannot view databases or tables.

Does anyone have a clue about what the problems may be or where I 
should start?

---
Bill Green
20 Meadowview Drive
Asheville, NC 28804
--
[EMAIL PROTECTED]
http://www.billgreen.org
828.252.1492
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


<    1   2   3   4   5   6   7   8   9   10   >