Results 1 to 1 of 1

Thread: mistake in mysql script

  1. #1
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default mistake in mysql script

    hi, i have mistake made in this script: the problem is, that when i push POST(type='padekoti') i got answer already exists. But my variables and table "balsai" is totaly emplty...
    PHP Code:
    <?php
    include('../db_conn.php');
    $id $_GET['id'];
    if(isset(
    $_POST['padekoti'])) {
        
    $queryget mysql_query("SELECT * FROM forumas WHERE id = '$id' ORDER BY `date`") or die("Error with query55");    
        while (
    $row mysql_fetch_array($queryget)) 

        
    $hx $row['thx'];
        
    $nick $row['nick'];
        
    $nack $_SESSION['nick'];
    $queryget1 mysql_query("SELECT * FROM balsai WHERE id = '$id' AND nick ='$nack'");
    if (
    $queryget1) { echo "already exists"; } else {    

        
    $nack $_SESSION['nick'];
        
    $thx $hx 1;
        
    $times '1';
        
    mysql_query("UPDATE forumas SET thx = '$thx' WHERE id = '$id'");
        
    mysql_query("INSERT INTO balsai (id, nick, times) 
            VALUES('
    $id', '$nack', '$times')") or die(mysql_error());
    }}}
    ?>
    If you need some more info, ask which...THANKS
    Last edited by auriaks; 11-12-2009 at 01:51 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •