Jump to content

cdc5205

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cdc5205's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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. no you shouldn't have to, id o it all the time, did you remove the $conn var from the mysql_query and you are selecting a database in connect.php? mysql_select_db("mydb");
  3. 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]
  4. show all the code you have, you are making a connection to the db right at $conn?
  5. [code]$sql = "INSERT INTO answers (id) VALUES ('$newid')";[/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.