Jump to content

[SOLVED] hello


jakebur01

Recommended Posts

mysql_connect("localhost","myuser","mypass");
mysql_select_db("mydatabase");
$now =  strtotime(date("Y/m/d H:i:s"));
$expire = $now + (60 * 60 * 24 * 30);
$values = "'$username','$first','$last','$pass',1,'$now','$expire'";
$cols = "username,first,last,password,billing,created,expire";
$id = db_insert ("users", $cols, $values);
mysql_close(); 

echo "<br><br> Account #$id Created";
$_SESSION ["cur_user"] = $id;


echo "<Br><Br>Saving contact Info Record Number: ";

 

I tried mysql_insert, i get :Call to undefined function mysql_insert()

Link to comment
Share on other sites

was their a file included before if not your need to add the SQL Statements yourself

 

ie

<?php
$query = "INSERT INTO table_name (column1, column2,...)  VALUES (value1, value2,....)";

        $result = @mysql_query($query, $id) or
            MySQL_ErrorMsg ("Unable to perform query: $query");
?>

Link to comment
Share on other sites

here

 

<?php
$id  =mysql_connect("localhost","myuser","mypass");
mysql_select_db("mydatabase");

$now =  strtotime(date("Y/m/d H:i:s"));
$expire = $now + (60 * 60 * 24 * 30);
$tablename = ""; // <-- i don't know what the table name is
$values = "'$username','$first','$last','$pass',1,'$now','$expire'";
$cols = "username,first,last,password,billing,created,expire";
//$id = db_insert ("users", $cols, $values); // <--Removed

$query = "INSERT INTO $tablename ($cols)  VALUES ($values)";

        $result = @mysql_query($query, $id) or
            MySQL_ErrorMsg ("Unable to perform query: $query");
mysql_close(); 

echo "<br><br> Account #$id Created";
$_SESSION ["cur_user"] = $id;


echo "<Br><Br>Saving contact Info Record Number: ";


?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.