04-28-2004
If you load up your 'server admin' tool and connect to the server, have a look under Web, go to the 'settings' tab at the bottom and have a look under 'Modules'
Is php4_module checked?
9 More Discussions You Might Find Interesting
1. Cybersecurity
with a limited knowledege of php and sql, what is a good and secure way to do passwords running an https server? (1 Reply)
Discussion started by: macdonto
1 Replies
2. UNIX for Advanced & Expert Users
MySQL on my server is down....
I figured out that the mysqld process isn't running. When I try to run it, it says it can't find mysql.sock
Any suggestions?
Here's what I can't do:
can't be root
don't have physical access (do stuff via SSH)
reinstall MySQL (need to keep the current MySQL... (8 Replies)
Discussion started by: _hp_
8 Replies
3. UNIX for Dummies Questions & Answers
I want to design a database, using mysql as a backend, and PHP as the frontend, I wanna be able to easily build forms in PHP to communicate with MySQL, is there any programs that will allow this, I really dont want to program all the forms by hand..
thankyou (2 Replies)
Discussion started by: kwalick
2 Replies
4. Shell Programming and Scripting
No help guys??? :(
Hi guys, i've got a question here... my intention is to write a script that would access a mysql db and extract some info and paste it into a file...
so the first move would be, to access the mysql interface right? hence...
#! /usr/bin/ksh
echo "Job Begin: " `date`
... (1 Reply)
Discussion started by: 12yearold
1 Replies
5. Programming
Hello every one
i have question i want to build DATAbase using PHP as interface
i use shell to access to linux . i have in linux psql and SQLplus
i'll call all html files that has db tabels from shell directory.
what should to do before design php pages. can build the database sql design... (3 Replies)
Discussion started by: Scotch
3 Replies
6. Shell Programming and Scripting
Hi Experts,
I am a beginner of PHP and trying to create a tutorial database. My web interface takes a value and inserts into table very correctly. But when I refresh the same interface, it inserts the same value again and again. My code is below:
<?php
$con =... (2 Replies)
Discussion started by: naw_deepak
2 Replies
7. Emergency UNIX and Linux Support
Hi,
I have two websites:
website1.com and website2.com
I didn't write either but have successfully moved all the files from website1.com to website2.com
I (thought) I installed all the correct php modules and website2 is mostly up and running. However, my boss found that when we go to a... (15 Replies)
Discussion started by: Astrocloud
15 Replies
8. Programming
Hello,
While I was interpretation the PHP manual on database security the recent past, it said that you should by no means connect to the database as the super user but rather as one more user with more limited options.
My question is:
How do you generate new users and set access... (2 Replies)
Discussion started by: AimyThomas
2 Replies
9. Web Development
Database Structure
Root Table
ID Root_ Node Level
1 A 0
2 B 1
3 C 1
Child Table
ID Left_Node Right_Node Root_Node Root_ID
1 B C A 1
... (1 Reply)
Discussion started by: Deepak Tiwari
1 Replies
LEARN ABOUT PHP
mysql_insert_id
MYSQL_INSERT_ID(3) 1 MYSQL_INSERT_ID(3)
mysql_insert_id - Get the ID generated in the last query
SYNOPSIS
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should
be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
omysqli_insert_id(3)
o PDO::lastInsertId
int mysql_insert_id ([resource $link_identifier = NULL])
DESCRIPTION
Retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
o $
link_identifier -The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect(3) is
assumed. If no such link is found, it will try to create one as if mysql_connect(3) was called with no arguments. If no connection
is found or established, an E_WARNING level error is generated.
The ID generated for an AUTO_INCREMENT column by the previous query on success, 0 if the previous query does not generate an AUTO_INCRE-
MENT value, or FALSE if no MySQL connection was established.
Example #1
mysql_insert_id(3) example
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydb');
mysql_query("INSERT INTO mytable (product) values ('kossu')");
printf("Last inserted record has id %d
", mysql_insert_id());
?>
Caution
mysql_insert_id(3) will convert the return type of the native MySQL C API function mysql_insert_id() to a type of long (named int in
PHP). If your AUTO_INCREMENT column has a column type of BIGINT (64 bits) the conversion may result in an incorrect value. Instead,
use the internal MySQL SQL function LAST_INSERT_ID() in an SQL query. For more information about PHP's maximum integer values,
please see the integer documentation.
Note
Because mysql_insert_id(3) acts on the last performed query, be sure to call mysql_insert_id(3) immediately after the query that
generates the value.
Note
The value of the MySQL SQL function LAST_INSERT_ID() always contains the most recently generated AUTO_INCREMENT value, and is not
reset between queries.
mysql_query(3), mysql_info(3).
PHP Documentation Group MYSQL_INSERT_ID(3)