Jump to content

cdc5205

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Posts posted by cdc5205

  1. [code]<?php
    mysql_connect("localhost","un","pw");
    mysql_select_db("dbname");
    $bob="Bob";
    mysql_query("INSERT INTO users(username) VALUE ('$bob')")  or die("query" .mysql_error());
    echo "done";
    ?>[/code]

    i just typed this and tested it and it works
  2. are you getting an error at the die() statement? try not making $result a var.
    [code]<?php
    session_start();
    if(isset($_SESSION['random'])) {
    //do nothing
    }
    else
    {
    $newid = rand(1,9999999);
    $_SESSION['random'] = $newid;
    include("../connect.php");
    $sql = "INSERT INTO answers (id) VALUES ('$newid')";
    mysql_query($sql) or die("An error has occured - Please contavt admin stating error @ point A1" . mysql_error());
    }
    ?>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.