Problem with mysql_query

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

    #1

    Problem with mysql_query

    Hi!

    I´m trying to execute a query, but I receive an error ("error in
    executing"). The strange thing is that the $link sentence has no
    errors, so the connection is fine.

    $server="localh ost";
    $database="myda tabase";
    $dbpass="mypass ";
    $dbuser="myuser ";

    $link=mysql_con nect($server,$d buser,$dbpass)
    or die ("couldn´t connect");

    mysql_query('up date articulos set rank=rank + 1 where id=$id', $link)
    or die ("error in executing");

    Any suggestion?

    Thanks!

    Ezequiel

  • Jerry Stuckle

    #2
    Re: Problem with mysql_query

    zek2005 wrote:
    Hi!
    >
    I´m trying to execute a query, but I receive an error ("error in
    executing"). The strange thing is that the $link sentence has no
    errors, so the connection is fine.
    >
    $server="localh ost";
    $database="myda tabase";
    $dbpass="mypass ";
    $dbuser="myuser ";
    >
    $link=mysql_con nect($server,$d buser,$dbpass)
    or die ("couldn´t connect");
    >
    mysql_query('up date articulos set rank=rank + 1 where id=$id', $link)
    or die ("error in executing");
    >
    Any suggestion?
    >
    Thanks!
    >
    Ezequiel
    >
    Yea, figure out what MySQL doesn't like about it. Check out mysql_error().

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • zek2005

      #3
      Re: Problem with mysql_query

      On 3 mar, 03:54, Jerry Stuckle <jstuck...@attg lobal.netwrote:
      zek2005 wrote:
      Hi!
      >
      I´m trying to execute a query, but I receive an error ("error in
      executing"). The strange thing is that the $link sentence has no
      errors, so the connection is fine.
      >
      $server="localh ost";
      $database="myda tabase";
      $dbpass="mypass ";
      $dbuser="myuser ";
      >
      $link=mysql_con nect($server,$d buser,$dbpass)
      or die ("couldn´t connect");
      >
      mysql_query('up date articulos set rank=rank + 1 where id=$id', $link)
      or die ("error in executing");
      >
      Any suggestion?
      >
      Thanks!
      >
      Ezequiel
      >
      Yea, figure out what MySQL doesn't like about it. Check out mysql_error().
      >
      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstuck...@attgl obal.net
      =============== ===- Ocultar texto de la cita -
      >
      - Mostrar texto de la cita -
      I receive the following error:

      "No database selected"

      but shouldn't I receive that error before when I do the connection in
      $link ???

      Thanks!

      Comment

      • Michael Fesser

        #4
        Re: Problem with mysql_query

        ..oO(zek2005)
        >I receive the following error:
        >
        >"No database selected"
        >
        >but shouldn't I receive that error before when I do the connection in
        >$link ???
        Connecting to a server and selecting a DB are two different things.




        Micha

        Comment

        Working...