Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an Install script

Status
Not open for further replies.

dexthageek

IS-IT--Management
Mar 23, 2002
59
US
Does anyone here know how to create an installation script.
I have an application for users to create accounts on and during inital account creation i have to create rows in multiple tables for each new user that is created.

What I want is a script or someone to point me in the right direction on how to create a script that I can have display to the user if the row was correctly created in realtime. I have seen it on a few other php applications I have installed but I cant remember which ones.

I hope i havent confused you completely.

Thanks in advance.
Mike
 
...if the row was correctly created in realtime".

DO you mean each row in each table?
Have you got some sample code?
 
Sorry I didnt think i made myself clear. Let me try again.

The follow is a list of INSERT STATEMENTS what I want to do is
have a script that will print out a message (eg. Failed, Successful) after each db query is processed.
Code:
	$db->query("INSERT INTO {$tbl_prefix}webs (tid, school, subject, theme) VALUES('$_SESSION[id]', '$school', '$subject', '$theme')");
	$db->query("INSERT INTO {$tbl_prefix}webs (tid, school, subject, theme) VALUES('$_SESSION[id]', '$school', '$subject', '$theme')");
 
It sounds like you know more than me anyway! :)
I don't know what db class that is, but is there an error function in there?
Maybe:
Code:
    $db->query("INSERT INTO {$tbl_prefix}webs (tid, school, subject, theme) VALUES('$_SESSION[id]', '$school', '$subject', '$theme')");
if (!$db->error())
{
  echo "Successfully inserted";
}
else
{
  echo $db->error();
}
    $db->query("INSERT INTO {$tbl_prefix}webs (tid, school, subject, theme) VALUES('$_SESSION[id]', '$school', '$subject', '$theme')");
etc....... etc...

Sorry I'm not much help
 
Yea thats a DB class that I wrote myself and error output called from the class which then calls a function I wrote to display more information in the event of an SQL Error

Im gonna play around with it and see what I can come up with. If anyone else has any ideas that would be great.

Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top