Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I am soooooo close, I can feel it

Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
09-18-2007 17:51
Thanks for all the help so far, but writing to a sql database on my site is still not working. Here is the code I currently have (I have tried literally 100 variations):

FYI - i changed my web site and passwords to secondlife for privacy reasons

LSL:

default
{
state_entry()

{
llSetText( "Touch to open your free secondlife.com account", < 1,1,1>, 1 );
}

touch_start(integer total_number)

{

string name;
string password;

name = llDetectedName(0);
password = llDetectedKey(0);

llInstantMessage(llDetectedKey (0), "Your Login name is your Second Life Name, " + name + ". Your password is " + password + ". Please copy your password from History and visit www.secondlife.com where you can then change your password to something you remember.";);

llHTTPRequest( "http://www.secondlife.com/attempt2.php", [HTTP_METHOD,"PUT",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], "name&password";);
}

}





PHP:

<?php

$host="secondlife.secureserver.net";
$user="secondlife";
$pwd="secondlife";
$sys_dbname="secondlife";

$password = $_POST["password"];
$name = $_POST["name"];

$link = mysql_connect($host, $user, $pwd) or die('MySQL Error');
mysql_select_db($sys_dbname, $link) or die('MySQL Error');

$query = "INSERT INTO 'register' ('password', 'Second_Life_Name') VALUES ("$password", "$name";)";

mysql_query($query) or die(mysql_error());
mysql_close();

?>


And thanks again for the previous help I have received. Learning LSL, PHP and SQL at one time is a big project, but I am making good progress thanks to all of you. If anyone has further comments about the above code, that would be appreciated. Many thanks:)

Everett
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
09-18-2007 18:14
again in the wrong forum
Raymond Figtree
Gone, avi, gone
Join date: 17 May 2006
Posts: 6,256
09-18-2007 18:20
He was sooooooo close too....
_____________________
Read or listen to some Eckhart Tolle. You won't regret it.
New Wind
Registered User
Join date: 10 Oct 2006
Posts: 100
09-18-2007 18:30
lol thx for laugh guys speacaly that he was so close tooooo
Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
Forum
09-18-2007 18:30
Well, I am looking for a Resident Answer:) At least that is what I am thinking when I post here, but you are right, scripting is better. Thanks, will move over.
Everett Streeter
Registered User
Join date: 28 Apr 2007
Posts: 20
Technically...
09-18-2007 18:33
...though since I am asking for PHP help, which I wouldn't consider scripting in terms of LSL, Resident Answers may be a good place too:)
Raymond Figtree
Gone, avi, gone
Join date: 17 May 2006
Posts: 6,256
09-18-2007 18:48
From: Everett Streeter
technically...though since I am asking for PHP help, which I wouldn't consider scripting in terms of LSL, Resident Answers may be a good place too:)
Can't hurt. Somebody who speaks mysql_query($query) or die(mysql_error())
help him please!
_____________________
Read or listen to some Eckhart Tolle. You won't regret it.
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
09-18-2007 23:59
Possibly this link could help:

http://secondlifehowto.com/blog2/2007/01/01/howto-connect-a-second-life-script-to-a-mysql-database/
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Cristalle Karami
Lady of the House
Join date: 4 Dec 2006
Posts: 6,222
09-19-2007 00:24
Please locate Scripting Tips a few fora down.
_____________________
Affordable & beautiful apartments & homes starting at 150L/wk! Waterfront homes, 575L/wk & 300 prims!

House of Cristalle low prim prefabs: secondlife://Cristalle/111/60

http://cristalleproperties.info
http://careeningcristalle.blogspot.com - Careening, A SL Sailing Blog