Problem is, REGEX will only test for a match, not returning anything other
than 0|1
You can instead:
1. Use a UDF doing just that (counting occurences in a string):
http://www.tsc.ro/free/
(haven't tried it myself, because no Windows dll available)
2. Replace successively all figures by '' and
Hi Owen
You can actually do it in MySQL..using the SUBSTRING_INDEX function -
SUBSTRING_INDEX(str,delim,count)
If your count is positive, SUBSTRING_INDEX returns everything to the left of
the count occurence of the delimiter (counting from left)
If count is negative, SUBSTRING_INDEX returns
From: Susan Ator [EMAIL PROTECTED]
If I have a field in mySQL consisting of a number with 8 digits a decimal
point and 4 more digits what is the field type it needs to be to sort it
numerically?
I've tried decimal(8,4) but it converts everything to .. I've
also tried float but
Emery
- Original Message -
From: Joe Nilson Zegarra Galvez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 26, 2003 19:38
Subject: Re: [PHP-DB] mysql, finding the last record
if you are seeking for the last in autoincrement field, in your select use
this:
select max(field
though I am not an expert.
Thanks
Emery
- Original Message -
From: Joe Nilson Zegarra Galvez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 26, 2003 19:38
Subject: Re: [PHP-DB] mysql, finding the last record
if you are seeking for the last in autoincrement field
On Saturday 27 September 2003 01:04, John Ryan wrote:
is there any quick way of selecting the 'last' row in a mysql table?? i
could write some messy code but id prefer an elegant solution.
mysql_num_rows()
mysql_data_seek()
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source
if you are seeking for the last in autoincrement field, in your select use
this:
select max(field) from table;
if is other, well, i dont remember :D
Regards
Nilson
John Ryan dijo:
is there any quick way of selecting the 'last' row in a mysql table?? i
could write some messy code but id
On Sat, 20 Sep 2003 19:54:18 +0400
äÒÕÞÉË ëÉÒÉÌÌ [EMAIL PROTECTED] wrote:
I have php 4.3.2, Apache 2.0.46 and MySQL 4.* on Windows 2000 SP4.
And i have problem.
When i make query from php to MySQL.
This work wery slow.
Every query 4-5 sec.
What i can make.
Sorry for error, i know english
I have been using Mysql for a long time, but I have a benchmark Q.
Is pgsql , better ? faster ? more reliable than mysql ?
any comment ?
I've only ever used Interbase and now Firebird. Latest
release is due any day and is FAST.
Some people say that php is not for a very big enterprise, banking ,
El Mié 24 Sep 2003 07:24, nabil escribió:
Dear all;
I have been using Mysql for a long time, but I have a benchmark Q.
Is pgsql , better ? faster ? more reliable than mysql ?
Maybe not faster in FTS, but surely MORE reliable!!!
any comment ?
Some people say that php is not
: Re: [PHP-DB] mySQL vs pgSQL | php vs others
El Mié 24 Sep 2003 07:24, nabil escribió:
Dear all;
I have been using Mysql for a long time, but I have a benchmark Q.
Is pgsql , better ? faster ? more reliable than mysql ?
Maybe not faster in FTS, but surely MORE reliable!!!
any comment
On Tue, 23 Sep 2003, AdminHMO wrote:
I am having trouble implementing a zip code locator program. All of the
functions work correctly but the $sql variable.
Try putting the SQL in quotes:
$sql = SELECT City FROM ZIPCodes WHERE Latitude = 122.02671343318 AND
Latitude = 121.96888656682 AND
Thanks for the suggestion but the quotes didn't make a difference I
submitted the sql though php myadmin that takes care of the quote syntax
Peter Beckman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Tue, 23 Sep 2003, AdminHMO wrote:
I am having trouble implementing a zip code
I am having trouble implementing a zip code locator program. All of the
functions work correctly but the $sql variable.
The problem occurs by using the latitude argument as a
comparison. The first
latitude argument works but when the second
latitude argument is added the query returns no
Thanks Jennifer,
I got the query and the zipcode longitude and latitude from the developer of
the zipcode locator. When I contacted them about this issue they had me run
this query in the phpMyAdmin against the zipcode date and I still got no
data returned.
Jennifer Goodie [EMAIL PROTECTED]
= 37.508048715329;
Jim
---Original Message---
From: AdminHMO
Date: Tuesday, September 23, 2003 13:35:31
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql field not resolving comaparison condition for
zip code locator
Thanks Jennifer,
I got the query and the zipcode longitude and latitude
On Mon, 22 Sep 2003, -{ Rene Brehmer }- wrote:
$result = mysql_query($query);
replace with:
$result = mysql_query($query) or die(MySQL Error: .mysql_error().\nbr/SQL:
.$query);
If the query fails, you will see why the query failed, and be able to view
the query itself. Maybe
Hi,
I think this is what you are trying to do. You get a record back that
has seveal fields and you want to reference those fields indiviually.
This is what I do in this example (which shows people information) and
present in HTML table
read the PHP manual and examples under the function mysql_fetch_array().
I find the MySQL manual is very well done and helpful. I've been using it as
a reference for 2 years. Take a harder look!
Ignatius
_
- Original Message -
From: -{ Rene Brehmer }- [EMAIL
On Mon, 22 Sep 2003 13:06:37 +0200
Ignatius Reilly [EMAIL PROTECTED] wrote:
read the PHP manual and examples under the function
mysql_fetch_array().
I find the MySQL manual is very well done and helpful. I've been using
it as a reference for 2 years. Take a harder look!
I think Ignatius
is there something wrong with my SQL Query? I didnt get any results
neither errors..
?php
$link = mysql_connect('localhost', 'username') or die('Cannot connect to
the database.');
mysql_select_db(profiles,$link);
$SQLQuery = INSERT INTO profyles (username, fname, mname, lname, address,
Ian Bert Tusil wrote:
is there something wrong with my SQL Query? I didnt get any results neither errors..
[snip]
mysql_query($SQLQuery,$link);
That's because you're not checking for errors...
mysql_query($SQLQuery,$link) or die(mysql_error());
--
---John Holmes...
Amazon Wishlist:
You have a couple of choices if I remember correctly.. For a table of name
'TBL':
describe TBL;
explain TBL;
show columns from TBL;
-Micah
On Wed September 10 2003 12:08 pm, Peter Beckman wrote:
So PHP is saying mysql_list_tables is depreciated. I replaced it with
mysql_query(SHOW TABLES
On Wed, 10 Sep 2003, Micah Stevens wrote:
describe TBL;
explain TBL;
show columns from TBL;
Yes, they do give the correct information.
However, my question was is there a nice simple SQL command that will
return exactly what mysql_list_fields (now depreciated) so that the
$result can be
http://www.mysql.com/doc/en/mysqldump.html
John Ryan
Is there any way *from the command line* to get a dump of a mysql
table and
have it saved to a local file, instead of standard output
from running mysqldump --help
-r, --result-file=... Direct output to a given file. This option should be
used in MSDOS, because it
On Wednesday, Sep 10, 2003, at 16:23 US/Eastern, John Ryan wrote:
Is there any way *from the command line* to get a dump of a mysql
table and
have it saved to a local file, instead of standard output
Have a look at man mysqldump, particularly the examples section.
If you're already dumping the
Now that I see code, I would say just run a 'SELECT * FROM table LIMIT 1' on
your table, and run it through your code. That should give you what you want.
-Micah
On Wed September 10 2003 12:55 pm, Peter Beckman wrote:
On Wed, 10 Sep 2003, Micah Stevens wrote:
describe TBL;
explain TBL;
How about piping the output to a file? As in:
mysqldump [OPTIONS] database [tables] outfile
Or using the --tab option?
-- John
Jeffrey N Dyke wrote:
http://www.mysql.com/doc/en/mysqldump.html
You should be very wary of the CREATE TABLE ... SELECT statement.
From experience, the types created are not always conform to intuition -
I've had my share of nasty surprises
Much safer to do a CREATE TABLE statement defining the column types, then do
an INSERT INTO ... SELECT
Ignatius
no quarrel with this behaviour.
Ignatius
_
- Original Message -
From: Peter Beckman [EMAIL PROTECTED]
To: Ignatius Reilly [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 4:13 PM
Subject: Re: [PHP-DB] MySQL, PHP or ghost?
On Wed, 27 Aug 2003
El Mié 27 Ago 2003 11:34, Ignatius Reilly escribió:
Hmmm...
You have a point; the doc is not quite clear.
Illegal YEAR values are converted to
My understanding is that any illegal value will be first converted into
'', then into the corresponding year inside the 1901-2155
, August 28, 2003 2:36 PM
Subject: Re: [PHP-DB] MySQL, PHP or ghost?
El Mié 27 Ago 2003 11:34, Ignatius Reilly escribió:
Hmmm...
You have a point; the doc is not quite clear.
Illegal YEAR values are converted to
My understanding is that any illegal value will be first converted
El Jue 28 Ago 2003 11:25, Ignatius Reilly escribió:
Well, it IS logical provided one is aware of the rules of the game,
meaning, as you rightly point out, that MySQL does not reject SQL
statements for incorrect values, but attempts at converting them at any
price. I have no clue whether it is
28, 2003 9:37 PM
Subject: Re: [PHP-DB] MySQL, PHP or ghost?
El Jue 28 Ago 2003 11:25, Ignatius Reilly escribió:
Well, it IS logical provided one is aware of the rules of the game,
meaning, as you rightly point out, that MySQL does not reject SQL
statements for incorrect values, but attempts
El Jue 28 Ago 2003 17:20, Ignatius Reilly escribió:
Well, you're certainly right (except I didn't get the meaning of 'FS' -
anything obscene?). However:
File System.
1. The job of this ML is to help people get things done
2. For criticisms concerning the design of MySQL, you may get better
Read the MySQL manual.
0 value is interpreted as 2000.
Your empty string is converted to an integer, thus 0.
HTH
Ignatius
_
- Original Message -
From: Peter Beckman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 3:39 AM
Subject: [PHP-DB]
Peter --
...and then Peter Beckman said...
%
% Seems that either I don't understand mysql, or something.
Looks like it, though I admit that the manual doesn't adequately explain
your results. Check out section 6.2.2.4 for details.
%
% My table, with the non-important things removed...
...
%
On Wed, 27 Aug 2003, Ignatius Reilly wrote:
Read the MySQL manual.
Hmmm, I thought I did. 6.2.2.4:
Illegal YEAR values are converted to .
0 value is interpreted as 2000.
Your empty string is converted to an integer, thus 0.
What confuses me (what I can't find) is why a quoted empty
its nothing to do with php as your working from the shell in your eg.
mysql will default to 2000 for a year value if you pass it as an entry because it
will accept short values for the years this century, eg pass it 1 and it'll give you
2001, so it thinks is nothing. if you want to default to
On Wed, 27 Aug 2003, David T-G wrote:
Looks like it, though I admit that the manual doesn't adequately explain
your results. Check out section 6.2.2.4 for details.
I did; see my previous (moments ago) email on my read on that manual
section.
% So my assumption is that if I insert with
Peter, et al --
...and then Peter Beckman said...
%
% On Wed, 27 Aug 2003, David T-G wrote:
%
% Looks like it, though I admit that the manual doesn't adequately explain
% your results. Check out section 6.2.2.4 for details.
%
% I did; see my previous (moments ago) email on my read on that
Hi Peter Beckman,
Seems that either I don't understand mysql, or something.
My table, with the non-important things removed...
mysql explain plate;
+-+---+--+-+-++
| Field | Type |
:[EMAIL PROTECTED]
Sent: 27 August 2003 15:29
To: Griffiths, Daniel
Subject: RE: [PHP-DB] MySQL, PHP or ghost?
On Wed, 27 Aug 2003, Griffiths, Daniel wrote:
mysql will default to 2000 for a year value if you pass it as an entry
because it will accept short values for the years this century, eg
On Wed, 27 Aug 2003, Ruprecht Helms wrote:
you have chosen a wrong format. The format for year is . With string
the field years don't know what to do.
Right -- and if it doesn't know what to do, why would it insert a value
that isn't correct and not give me an error? It does give a
-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 9:31 AM
To: Peter Beckman; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL, PHP or ghost?
Read the MySQL manual.
0 value is interpreted as 2000.
Your empty string is converted to an integer, thus 0.
HTH
How do I avoid the problem in the subject hereto? SELECT query uses
variable in the WHERE clause. Fails on the following query:
SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's
AE Exp' AND ...
Escape it.
SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA
try putting a \ before the apostrophe
-Original Message-
From: Dillon, John [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 12:59 PM
To: 'PHP-DB'
Subject: [PHP-DB] MySQL query failing on apostrophe in data
How do I avoid the problem in the subject hereto? SELECT query uses
From: Dillon, John [EMAIL PROTECTED]
How do I avoid the problem in the subject hereto? SELECT query uses
variable in the WHERE clause. Fails on the following query:
SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's
AE Exp' AND ...
Escape the single quote with a
if you're using php to generate this query you could use addslashes() to
the piece that is holding 11301201 0603A HKA 3902 #3708_JD's
AE Exp. this will escape the slashes making them \'
similarly if you're getting \' in your return values you can use
stripslashes()
www.php.net/addslashes
From: Jack van Zanen [EMAIL PROTECTED]
I have installed MYSQL 4.1 with support for derived tables. If I query
Mysql
with a query that has a subquery in the from clause it works fine. If I
now
load this query in PHP I get invalid resource error. If I change the
select
for another select w/o the
-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 4:11 PM
To: Jack van Zanen Prive; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MYSQL 4.1 derived tables and PHP
From: Jack van Zanen [EMAIL PROTECTED]
I have installed MYSQL 4.1 with support for derived tables. If I
Wendell Frohwein wrote:
Hello all, I have this page where I search and add up commissions in a
mysql database. I want to select commissions between a certain date
range.
This is what im currently using but it does not seem to work.
$from=20030101;
$to=20031230;
$search=mysql_query(SELECT
hav u tried using dashes to denote which portion is the year, month, or
day ?
e.g. instead of 20030101, you'd probably want to use 2003-01-01.
Wendell Frohwein wrote:
Hello all, I have this page where I search and add up commissions in a
mysql database. I want to select commissions between a
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 3:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
Oops, my mistake, it's not a blank entry - it re enters the
last entry.
I can hit F5 or click refresh 1000 times
On Wednesday 06 August 2003 01:14, Jeff wrote:
Well I did what you said, and now I get Parse error: parse error,
unexpected T_ECHO in C:\FoxServ\www\encana_db.php on line 44
Try:
$result = mysql_query($query, $link_id) OR die(mysql_error());
--
Jason Wong - Gremlins Associates -
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 3:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
Every time I access or refresh the page, it adds one blank
entry to the DB.
Maybe I have the insert query
posgreSQL
-Original Message-
From: Richard [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 1:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL and PHP?
Hello
I hope this is a rumour but I heard that MySQL is now fully GPL which it
wasn't earlier.
I think the part used to
:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
Oops, my mistake, it's not a blank entry - it re enters the
last entry.
I can hit F5 or click refresh 1000 times and it will enter
the last entry
1000 times.
Jeff [EMAIL PROTECTED] wrote in message
news
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
says...
Hello Mark,
I have tryed it by splitting the file into pices and then insert it with the
help of phpmyadmin. This woked.
however, I do have some more files to upload, and this seems to be not the
fastest way:-)
I tryed this:
]
cc:
Subject: Re: [PHP-DB] MySQL Returns
Error
This is how I implemented a similar though not exactly the same problem:
$tempdate = gmdate(d-m-Y);
$insertSQL = sprintf(INSERT INTO gennews (newsdate, newsheadline,
country, newsfull) VALUES ($tempdate, %s, %s, %s);
So, you only have to change the format of the gmdate what you want.
Bunmi
Hi
Check the database name is exactly the same case as you are using - not
Soverign rather soverign for example.
After that try the raw php functions for connecting to the database
?php
//require_once 'DB.php';
$user = 'jbyrne';
$pass = '';
$host = 'localhost';
$db_name = 'sovereign';
if($dsn
You could use mysqlimport with --fields-terminated-by=;
or you could open it in something like Excel, parse it there (text to
columns), and save it as a CSV
or you could read it line by, line into PHP, explode each line on the
;, then insert the data into MySQL
or you could write a
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
Every time I access or refresh the page, it adds one blank
entry to the DB.
Maybe I have the insert query in the wrong place?
if ('POST' == $_SERVER['REQUEST_METHOD']) {
//someone submitted the form with method=post
// so validate input
- is there
somewhere special I need to put that?
Matt Schroebel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 3:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
this. This is how I have handled
it
in the past though.
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 3:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
Oops, my mistake, it's not a blank entry - it re enters the
last
Budelak wrote:
This is how I implemented a similar though not exactly the same problem:
$tempdate = gmdate(d-m-Y);
$insertSQL = sprintf(INSERT INTO gennews (newsdate, newsheadline,
country, newsfull) VALUES ($tempdate, %s, %s, %s);
So, you only have to change the format of the gmdate what you
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 12:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Returns Error
Been working on this code all weekend, and I did take
everyone's advice, but
I'm still getting the same error. Error
]
Subject: Re: [PHP-DB] MySQL Returns Error
Ok, that worked,
Now the error I'm getting is Duplicate entry ' ' for key 1
Is this a SQL table error?
Here's my Table as entered:
CREATE TABLE gradients (
gradient MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,
kwo VARCHAR(10) NOT NULL,
lsd VARCHAR
Change the gradient definition to:
gradient MEDIUMINT(10) NOT NULL AUTO_INCREMENT,
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 1:44 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
Ok, that worked,
Now the error
Ok, that worked,
Now the error I'm getting is Duplicate entry ' ' for key 1
Is this a SQL table error?
Here's my Table as entered:
CREATE TABLE gradients (
gradient MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,
kwo VARCHAR(10) NOT NULL,
lsd VARCHAR(10) NOT NULL,
date DATE DEFAULT
I am running PHP with Abyss Webserver on Windows XP Home, and MySQL works
OK. If I am not using the mysql console, I use PHPMyAdmin as a friendlier
front end for MySQL.
Rob
Larry R. Sieting [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
At 07:44 PM 7/31/2003 +0100, John Ryan wrote:
I just need to know how to enter the data submitted by an html form
into a
MySQL DB.
I have already created the form, and the variables in that form - just
need
to know the query use to insert that data.
The query will be something like
INSERT INTO tablename (column1, column2, column3, ...)
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,
,
formation) VALUES ('$kwo', '$lsd', '$date', '$well', '$field', '$uni',
'$license', '$formation')
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: August 1, 2003 12:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL
On Saturday 02 August 2003 01:46, Jeff wrote:
I
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 )
?php
$link_id = mysql_connect(localhost,admin,***)
or die(Unable to connect to SQL server);
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,
Oh, and another thing, in this book I have, they say to give the forum
action ?php echo $PHP_SELF ?.
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
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
At 07:44 PM 7/31/2003 +0100, John Ryan wrote:
i installed php and apache fine on my pc, but mysql is giving problems. in
winmysqladmin, you cant create a adb on the databases tab. all that lets you
do is flush threads, flush processes, etc. so i had to create my database
through the mysql command
Don't know about your date format, but you have named your table column DATE
which is a reserved keyword in MySQL. Try naming that something different
and see if you still get the error.
-Original Message-
From: Andrew D. Luebke [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2003
Nope, changed the insert to:
$result = mysql_query(INSERT INTO Boats (Make, Model, Serial,
Stock, Extension, Cust_Name, Store, Insert_Date) VALUES
('$make', '$model', '$serial', '$stock', '$extension',
'$name', '$store', '$date')
or die(Invalid query: .
From: Andrew D. Luebke [EMAIL PROTECTED]
$date = date(Y-m-d H:i:s);
$result = mysql_query(INSERT INTO Boats (Make, Model, Serial,
Stock, Extension, Cust_Name, Store, Date) VALUES
('$make', '$model', '$serial', '$stock', '$extension',
'$name', '$store',
here. Try changing the field name and give that a shot. I think I am
actually right here though.
Scott
-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2003 1:19 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] MySQL Date insert
Don't know about
i have a feeling oyu're not getting a mysql error but a PHP error??? you
have an odd number of parentheses and mysql_error will not have an closing
paren.
if that is the case, try this
mysql_query(INSERT INTO Boats (Make, Model, Serial,Stock, Extension,
Cust_Name, Store, Date) VALUES
Andrew, try this:
$date = date('Y m d H i s');
A similar syntax (with single quotes rather than double, and without
intervening dashes) has worked for me in some MySQL-related PHP code I've
just written. My code looked like this:
$title2 = \nh3 align=\center\.date('l F d Y').\n/h3;
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED]
I actually think I know part of this answer... I don't think you
need to define a variable to insert into your date field. Inserting an
empty value into this filed will populate the field in the database with
the
current time, which it appears
John, thanks, now I feel stupid, it's always the silly little things that
get you. You were right, when I added the date to the existing insert I
forgot to put the ending parentheses back in. Thanks for the help.
Andrew.
At 11:26 AM 7/28/2003, CPT John W. Holmes wrote:
From: Andrew D. Luebke
Hi
welcome to php :)
in general you can use an include at the beginning of each page
?php
include('database_conn.php' ) ;
$query = 'select * from table'
$result = ($query, $link)
?
-Original Message-
From: Morten Twellmann [mailto:[EMAIL PROTECTED]
Sent: 27 July 2003 13:01
To:
Here's how I do it using functional PHP programming (you may prefer using OO
PHP which I don't bother with) :
I include a generic functions file in each page. You could take it further,
opening and closing the database connection for every query, but this way is
more efficient if more than open
Thanks for that, but I get a NULL entry in the field then for all the dates.
- Original Message -
From: Moreno Riccardi [EMAIL PROTECTED]
To: Morgan Bardon [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, July 25, 2003 4:34 PM
Subject: R: [PHP-DB] MYSQL and PHP cast() function...
Thanks for that, but I get a NULL entry in the field then for all the
dates.
What column type is the DATE column? Also, since DATE is a reserved word in
MySQL, naming a column DATE probably wasn't a good idea. If you know you
always want the first 11 characters, you can always do LEFT(Date,11)
, July 25, 2003 4:44 PM
Subject: Re: [PHP-DB] MYSQL and PHP cast() function...
Thanks for that, but I get a NULL entry in the field then for all the
dates.
What column type is the DATE column? Also, since DATE is a reserved word
in
MySQL, naming a column DATE probably wasn't a good idea
Full text searches only work against fulltext indexes.
http://www.mysql.com/doc/en/Fulltext_Search.html
This isn't a PHP issue.
Doug
On Fri, 18 Jul 2003 09:42:17 +0200, Angelo Zanetti wrote:
Hi
I have a table which contains 3 fields (ID, Title, Abstract) the title and abstract
fields have
I have:
WinNT_4.00 Server
Apache
PHP_5
MySQL_4
[myscript.php]
...
$link = mysql_pconnect();
...
-
If you run php.exe myscript.php,
you'll get message: Fatal error: Call to undefined function:
mysql_pconnect()...
HOW TO DECIDE THIS PROBLEM ?
Have you installed the
Have you installed the php_mysql module in PHP5, it is not
included by default now.
Where can I find this Library?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
mysql knows. this means your query failed, $command resulted in an invalid
result set. try adding: or die(mysql_error()); to any call to mysql_query
()so in your code use this:
$result = mysql_query($command,$mysqlHandle) or die(mysql_error());
- and -
$resultw =
Hi,
You have only to modify it to your environement
It works with mysql = 3.23.52
// Get all table names of the database
//
$sql = '
SHOW TABLES
FROM
test_db
;
$db-query($sql);
while($row = $db-fetchRow( 'DB_GETMODE_NUM'))
{
I use an db abstraction class. You have to replace this by yours. Of
course you got a Fatal error: Call to a member function on a
non-object because such an object dosen't exist in your script. First
you have to connect to a database using mysql_connect() and using
mysql_query and
401 - 500 of 916 matches
Mail list logo