PHPMyAdmin adding backslashes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Graham Thomson

    PHPMyAdmin adding backslashes

    Hi,

    I've recently started looking at PHP and MY SQL within Dreamweaver MX.

    I'm usin PHPMyAdmin and put some example code from my tutorial book into it
    and pressed "Go".

    However, the code came out as it does below with a load of backslashes
    aadded. As early as line 3 the code should read default '0' but instead
    reads default \'0\'

    Anybody tel me why this is happening?

    Thanks
    Graham

    CREATE TABLE bookings (
    ID tinyint(11) NOT NULL auto_increment,
    roomID tinyint(11) NOT NULL default \'0\',
    client ID tinyint(11) NOT NULL default \\\'0\\\',
    startDate date NOT NULL default \\\'0000-00-00\\\\\\\',
    endDate date NOT NULL default \\\'0000-00-00\\\',
    adults int(11) NOT NULL default \\\'1\\\',
    children int(11) NOT NULL default \\\'0\\\',
    roomType varchar(30) NOT NULL default \\\'\\\',
    roomOptions int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
    networkConnecti on int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
    PC int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
    requirements varchar(250) NOT NULL default \\\\\\\\\\\\\\\ '\\\\\\\\\\\\\\ \',
    PRIMARY KEY (ID)
    ) TYPE=MyISAM COMMENT=\\\\\\\ \\\\\\\\'Room Booking Table\\\\\\\\\\ \\\\\';


  • Marcel

    #2
    Re: PHPMyAdmin adding backslashes


    "Graham Thomson" <graham.thomson @hotmail.com> schreef in bericht
    news:pCcab.2089 $sj.1980@news-binary.blueyond er.co.uk...[color=blue]
    > Hi,
    >
    > I've recently started looking at PHP and MY SQL within Dreamweaver MX.
    >
    > I'm usin PHPMyAdmin and put some example code from my tutorial book into[/color]
    it[color=blue]
    > and pressed "Go".
    >
    > However, the code came out as it does below with a load of backslashes
    > aadded. As early as line 3 the code should read default '0' but instead
    > reads default \'0\'
    >
    > Anybody tel me why this is happening?
    >
    > Thanks
    > Graham
    >
    > CREATE TABLE bookings (
    > ID tinyint(11) NOT NULL auto_increment,
    > roomID tinyint(11) NOT NULL default \'0\',
    > client ID tinyint(11) NOT NULL default \\\'0\\\',
    > startDate date NOT NULL default \\\'0000-00-00\\\\\\\',
    > endDate date NOT NULL default \\\'0000-00-00\\\',
    > adults int(11) NOT NULL default \\\'1\\\',
    > children int(11) NOT NULL default \\\'0\\\',
    > roomType varchar(30) NOT NULL default \\\'\\\',
    > roomOptions int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
    > networkConnecti on int(8) NOT NULL default[/color]
    \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',[color=blue]
    > PC int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
    > requirements varchar(250) NOT NULL default[/color]
    \\\\\\\\\\\\\\\ '\\\\\\\\\\\\\\ \',[color=blue]
    > PRIMARY KEY (ID)
    > ) TYPE=MyISAM COMMENT=\\\\\\\ \\\\\\\\'Room Booking Table\\\\\\\\\\ \\\\\';
    >
    >[/color]


    Have a look at the magic_quotes option in php.ini .... this is causing the
    backslashes...

    Marcel


    Comment

    • Graham Thomson

      #3
      Re: PHPMyAdmin adding backslashes

      Sorry, I don't understand where do I find this magic_quotes in php.ini?

      Thanks
      Graham
      "Marcel" <neegeenspam@ho tentottententen tentoonstelling en.nl> wrote in
      message news:3f695a22$0 $5773$edd6591c@ news.versatel.n et...[color=blue]
      >
      > "Graham Thomson" <graham.thomson @hotmail.com> schreef in bericht
      > news:pCcab.2089 $sj.1980@news-binary.blueyond er.co.uk...[color=green]
      > > Hi,
      > >
      > > I've recently started looking at PHP and MY SQL within Dreamweaver MX.
      > >
      > > I'm usin PHPMyAdmin and put some example code from my tutorial book into[/color]
      > it[color=green]
      > > and pressed "Go".
      > >
      > > However, the code came out as it does below with a load of backslashes
      > > aadded. As early as line 3 the code should read default '0' but instead
      > > reads default \'0\'
      > >
      > > Anybody tel me why this is happening?
      > >
      > > Thanks
      > > Graham
      > >
      > > CREATE TABLE bookings (
      > > ID tinyint(11) NOT NULL auto_increment,
      > > roomID tinyint(11) NOT NULL default \'0\',
      > > client ID tinyint(11) NOT NULL default \\\'0\\\',
      > > startDate date NOT NULL default \\\'0000-00-00\\\\\\\',
      > > endDate date NOT NULL default \\\'0000-00-00\\\',
      > > adults int(11) NOT NULL default \\\'1\\\',
      > > children int(11) NOT NULL default \\\'0\\\',
      > > roomType varchar(30) NOT NULL default \\\'\\\',
      > > roomOptions int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
      > > networkConnecti on int(8) NOT NULL default[/color]
      > \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',[color=green]
      > > PC int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
      > > requirements varchar(250) NOT NULL default[/color]
      > \\\\\\\\\\\\\\\ '\\\\\\\\\\\\\\ \',[color=green]
      > > PRIMARY KEY (ID)
      > > ) TYPE=MyISAM COMMENT=\\\\\\\ \\\\\\\\'Room Booking[/color][/color]
      Table\\\\\\\\\\ \\\\\';[color=blue][color=green]
      > >
      > >[/color]
      >
      >
      > Have a look at the magic_quotes option in php.ini .... this is causing the
      > backslashes...
      >
      > Marcel
      >
      >[/color]


      Comment

      • Graham Thomson

        #4
        Re: PHPMyAdmin adding backslashes

        Hi,

        I'm not sure what parameters to change in Magic Quotes - can you advise
        please?

        ; Magic quotes
        ;

        ; Magic quotes for incoming GET/POST/Cookie data.
        magic_quotes_gp c = on

        ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(),
        etc.
        magic_quotes_ru ntime = Off

        ; Use Sybase-style magic quotes (escape ' with '' instead of \').
        magic_quotes_sy base = off


        "Marcel" <neegeenspam@ho tentottententen tentoonstelling en.nl> wrote in
        message news:3f695a22$0 $5773$edd6591c@ news.versatel.n et...[color=blue]
        >
        > "Graham Thomson" <graham.thomson @hotmail.com> schreef in bericht
        > news:pCcab.2089 $sj.1980@news-binary.blueyond er.co.uk...[color=green]
        > > Hi,
        > >
        > > I've recently started looking at PHP and MY SQL within Dreamweaver MX.
        > >
        > > I'm usin PHPMyAdmin and put some example code from my tutorial book into[/color]
        > it[color=green]
        > > and pressed "Go".
        > >
        > > However, the code came out as it does below with a load of backslashes
        > > aadded. As early as line 3 the code should read default '0' but instead
        > > reads default \'0\'
        > >
        > > Anybody tel me why this is happening?
        > >
        > > Thanks
        > > Graham
        > >
        > > CREATE TABLE bookings (
        > > ID tinyint(11) NOT NULL auto_increment,
        > > roomID tinyint(11) NOT NULL default \'0\',
        > > client ID tinyint(11) NOT NULL default \\\'0\\\',
        > > startDate date NOT NULL default \\\'0000-00-00\\\\\\\',
        > > endDate date NOT NULL default \\\'0000-00-00\\\',
        > > adults int(11) NOT NULL default \\\'1\\\',
        > > children int(11) NOT NULL default \\\'0\\\',
        > > roomType varchar(30) NOT NULL default \\\'\\\',
        > > roomOptions int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
        > > networkConnecti on int(8) NOT NULL default[/color]
        > \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',[color=green]
        > > PC int(8) NOT NULL default \\\\\\\\\\\\\\\ '0\\\\\\\\\\\\\ \\',
        > > requirements varchar(250) NOT NULL default[/color]
        > \\\\\\\\\\\\\\\ '\\\\\\\\\\\\\\ \',[color=green]
        > > PRIMARY KEY (ID)
        > > ) TYPE=MyISAM COMMENT=\\\\\\\ \\\\\\\\'Room Booking[/color][/color]
        Table\\\\\\\\\\ \\\\\';[color=blue][color=green]
        > >
        > >[/color]
        >
        >
        > Have a look at the magic_quotes option in php.ini .... this is causing the
        > backslashes...
        >
        > Marcel
        >
        >[/color]


        Comment

        Working...