|
Posted by Johannes A. Brunner on 09/14/05 08:50
Andy Hassall wrote:
> The INSERT can't be doing that. The most common mistake in this sort of
> thing
> is setting up a race condition, so two requests both start a new session
> and overlap saving to the database.
But if I have a racecondition it would make no differenc using a variable or a fixed string.
$result = mysql_query("INSERT INTO session SET ssid='$season',ip='$rip'",$connect);
$result = mysql_query("INSERT INTO session SET ssid='season',ip='$rip'",$connect);
But the second line works fine. Just one db-entrie per page hit.
> How are you detecting there's no ssid?
@$ssid = $_GET['ssid'];
if (!isset($ssid)) { $ssid = ssid_generate(); ssid_register($ssid,'false','unknown','false'); }
> What are you doing with the ssid afterwards?
A lot of stuf,
Here is the way I create the ssid
function ssid_generate() {
$ssid = md5(time());
return $ssid;
}
[Back to original message]
|