Try putting tick marks (`) around the field and table names. So your
SQL query would then look like:
INSERT INTO `history` (`v_id`, `hour`, `visits`, `date`) VALUES (45, 0,
59, '2010 01 27');
This is a good practice to get into. The problem is that MySQL allows
you to create tables and
james stojan wrote on 11/02/2010 22:21:
$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
(.$v_id.,.$hour.,.$visits.,'$date1'.);;
The ,'$date1'. is not correct syntax, change it to ,'.$date.'
--
Kind regards
Kim Emax - masterminds.dk
--
PHP General Mailing List
Also, in PHP you should NOT put the last semi-colon at the end of your SQL
statement. http://www.php.net/manual/en/function.mysql-query.php
On Feb 11, 2010, at 1:26 PM, Joseph Thayne wrote:
Try putting tick marks (`) around the field and table names. So your SQL
query would then look like:
Thank you.
You were right on the money, hour was the problem and the tick marks
solved it. I spent 3 hours trying to figure out why I never got an error but
there was no insert and php myadmin does add the tick marks automatically.
Probably a good habit to always use the tick marks.
Learn
Actually, the syntax is just fine. I personally would prefer it the way
you mention, but there actually is nothing wrong with the syntax.
The ,'$date1'. is not correct syntax, change it to ,'.$date.'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:
Actually, the syntax is just fine. I personally would prefer it the way you
mention, but there actually is nothing wrong with the syntax.
The ,'$date1'. is not correct syntax, change it to ,'.$date.'
My personal
That is a good idea to use the curly braces. I consistently forget
about them, and fell like an idiot every time I am reminded of them.
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue was not that phpMyAdmin uses backticks, it is
that MySQL
Op 2/11/10 10:51 PM, James McLean schreef:
On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:
Actually, the syntax is just fine. I personally would prefer it the way you
mention, but there actually is nothing wrong with the syntax.
The ,'$date1'. is not correct
On Fri, Feb 12, 2010 at 9:31 AM, Jochem Maas joc...@iamjochem.com wrote:
Op 2/11/10 10:51 PM, James McLean schreef:
My personal preference these days is to use Curly braces around
variables in strings such as this, I always find excessive string
concatenation such as is often used when
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue was not that phpMyAdmin uses backticks, it is that
MySQL pretty much requires them when naming a field the same as an
Yeah, I am a lot more descriptive now. I ran into it quite a bit when I
was first starting out.
James McLean wrote:
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue
On Fri, Feb 12, 2010 at 09:44:47AM +1030, James McLean wrote:
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
As for the backticks, they are required because of MySQL, not because of
phpMyAdmin. The issue was not that phpMyAdmin uses backticks, it is that
for you and you can
then focus on other things such as data integrity and general processing
speed?
Joseph
-Original Message-
From: Paul M Foster [mailto:pa...@quillandmouse.com]
Sent: Thursday, February 11, 2010 9:15 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Mysql statement works
On Thu, Feb 11, 2010 at 09:49:02PM -0600, Joseph Thayne wrote:
I was going to write an example as to what should happen instead of what
actually does when id dawned on me why MySQL works the way it does. One of
the biggest complaints people have with MySQL is in speed.
The much-vaunted
14 matches
Mail list logo