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
https://forums.phpfreaks.com/topic/46209-solved-hello/#findComment-224655
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
https://forums.phpfreaks.com/topic/46209-solved-hello/#findComment-224657
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
https://forums.phpfreaks.com/topic/46209-solved-hello/#findComment-224658
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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