PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > converting mysql 4 statements to mysql 5
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
converting mysql 4 statements to mysql 5

Réponse
 
LinkBack Outils de la discussion
Vieux 27/09/2007, 08h54   #1
secSwami
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut converting mysql 4 statements to mysql 5

Hi,

I have few mysql4 statements that I would like to convert to mysql 5
format. As you can tell, I am not a programmer. Any will be
highly appreciated.

Thanks

CREATE TABLE resume (
id INT UNSIGNED AUTO_INCREMENT,
ip_addr INT UNSIGNED NOT NULL,
counter INT UNSIGNED NOT NULL,
last_update DATETIME NOT NULL,default 'now()',

PRIMARY KEY ( id ),

);

Whenever I execute it, I get syntax error with the defaul 'now()' ,
after doing some research I found that this now() function has been
replaced.

!!!!

Thanks in advance!

  Réponse avec citation
Vieux 27/09/2007, 10h37   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: converting mysql 4 statements to mysql 5

On 27 Sep, 08:54, secSwami <parvind...@gmail.com> wrote:
| I have few mysql4 statements that I would like
| to convert to mysql 5 format.
This statement fails in version 4 as well. Have you thought of reading
the relevant section of the manual and following the instructions? I
don't think the format of this statement has changed between the
versions.

| after doing some research I found that this now()
| function has been replaced.
It has? What research did you do? No one told me that it had been
replaced and it appears that no one told the developers either since I
am still using it in version 5 and so are lots of other people.

  Réponse avec citation
Vieux 27/09/2007, 21h24   #3
Kees Nuyt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: converting mysql 4 statements to mysql 5

On Thu, 27 Sep 2007 00:54:28 -0700, secSwami
<parvinderb@gmail.com> wrote:

>Hi,
>
>I have few mysql4 statements that I would like to convert to mysql 5
>format. As you can tell, I am not a programmer. Any will be
>highly appreciated.
>
>Thanks
>
>CREATE TABLE resume (
> id INT UNSIGNED AUTO_INCREMENT,
> ip_addr INT UNSIGNED NOT NULL,
> counter INT UNSIGNED NOT NULL,
> last_update DATETIME NOT NULL,default 'now()',
>
> PRIMARY KEY ( id ),
>
>);
>
>Whenever I execute it, I get syntax error with the defaul 'now()' ,
>after doing some research I found that this now() function has been
>replaced.


1: One comma too many
2: qouted 'now()' is a string, not a function call.

In other words, instead of:
NOT NULL,default 'now()',
try:
NOT NULL default now(),

>!!!!
>
>Thanks in advance!


Regards,
--
( Kees
)
c[_] The reasonable man adapts himself to the world; the
unreasonable one persists in trying to adapt the world
to himself. Therefore all progress depends on the
unreasonable man. (George Bernard Shaw) (#467)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h56.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09602 seconds with 11 queries