[PHP-DB] mssql_select_db
I have some code which connects to a remote SQL server. The code has worked fine for a year and now the mssql_select_db is failing. The code hasn't changed and I talked to the SQL Server admin who assures me nothing has changed and I am talking to the web host who says nothing changed...how can I debug this? The web host is running FreeBSD with the FreeTDS library and php 4.3.9. Is there a way to echo all of the mssql tables after I make the connection? I can connect fine, just can't select a db so I want to see what databases php can see. Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Php with MySQL replication
Have you made any progess with this yet? Could it simply be a delay due to replication log size before the replication is triggered...its much more a mysql issue than a php one... Bastien From: David Brinks [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Php with MySQL replication Date: Fri, 5 Aug 2005 17:20:22 -0400 I seem to be having a problem when using php with a replicated database and the replicated database not being updated correctly. I have verified that replication in general works. When transactions are entered through either a perl script or through console, the replicated client receives the updates almost instantly. When a transaction goes through php, on the other hand, the master database will be updated but the master does not seem to send the update to the replicated client. Mysql version are both 4.0.18. Mod_php4-4.3.7 is the php code. Sample from php script... $conn = mysql_connect($Server, $User, $Pass); $sql = INSERT INTO test.database VALUE ('','hello'); $result = mysql_query($sql,$conn); $closed = Mysql_close($conn); If anyone has any suggestions, I would appreciate it. Thanks. David Brinks --- Power-Net Internet Services [EMAIL PROTECTED] Local Office : 402 N. Mission, Mount Pleasant, MI 48858 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Getting error with IE
I am getting an error with IE when I load the page https://doctors.cardiactelecom.com Line: 6 Char: 1 Error: Object Expected Code: 0 [CODE] ?php require_once('Connections/mysql.php'); ? ?php // *** Validate request to login to this site. session_start(); $loginFormAction=$_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } [/CODE] Any help would be appreciated -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Getting error with IE
Its a js error, post the complete page code/ js code for the page bastien From: Vincent Lape [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Getting error with IE Date: Tue, 16 Aug 2005 16:59:11 -0400 I am getting an error with IE when I load the page https://doctors.cardiactelecom.com Line: 6 Char: 1 Error: Object Expected Code: 0 [CODE] ?php require_once('Connections/mysql.php'); ? ?php // *** Validate request to login to this site. session_start(); $loginFormAction=$_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } [/CODE] Any help would be appreciated -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Getting error with IE
?php require_once('Connections/mysql.php'); ? ?php // *** Validate request to login to this site. session_start(); $loginFormAction=$_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } if (isset($_POST['UserID'])) { $loginUsername=$_POST['UserID']; $password=$_POST['Passwd']; $MM_fldUserAuthorization = isauth; $MM_redirectLoginSuccess = ctc/index2.php; $MM_redirectLoginFailed = login_error.php; $MM_redirecttoReferrer = false; mysql_select_db($database_mysql, $mysql); $LoginRS__query=sprintf(SELECT username, password, isauth FROM webauth WHERE username='%s' AND password='%s', get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $mysql) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = mysql_result($LoginRS,0,'isauth'); //declare two session variables and assign them $GLOBALS['MM_Username'] = $loginUsername; $GLOBALS['MM_UserGroup'] = $loginStrGroup; //register the session variables session_register(MM_Username); session_register(MM_UserGroup); if (isset($_SESSION['PrevUrl']) false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header(Location: . $MM_redirectLoginSuccess ); } else { header(Location: . $MM_redirectLoginFailed ); } } ? html head titleCardiac Telecom Patient Information Login/title link REL=stylesheet TYPE=text/css HREF=file:///C|/Documents%20and%20Settings/vlape/My%20Documents/site_templa te/Webadmin/WinCss.css /HEAD BODY bgcolor=#FF onLoad=RunMe(); table width=90% border=0 cellspacing=0 cellpadding=3 align=center tr td center a href=index.phpimg src=content/logo.gif width=199 height=60 border=0/a form ACTION=?php echo $loginFormAction; ? method=POST name=LoginForm table width=63 border=0 cellspacing=0 cellpadding=3 align=center tr tdfont color=8F9CBCbfont size=2Username:/font/b/fontbr input type=text name=UserID class=txtbox /td /tr tr tdfont color=8F9CBCbfont size=2Password:/font/b/fontbr input type=password name=Passwd class=txtbox /td /tr tr td input type=image src=content/signin.gif width=64 height=18 name=image /td /tr /table /form /center /td /tr /table div align=centerfont size=1br a href=http://www.cardiactelecom.com; target=_blankbr Copyright copy; Cardiac Telecom Corporation /a/font/div /BODY /HTML -- Vincent Lape Systems Administrator, Cardiac Telecom Corporation. -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 5:04 PM To: [EMAIL PROTECTED]; php-db@lists.php.net Subject: RE: [PHP-DB] Getting error with IE Its a js error, post the complete page code/ js code for the page bastien From: Vincent Lape [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Getting error with IE Date: Tue, 16 Aug 2005 16:59:11 -0400 I am getting an error with IE when I load the page https://doctors.cardiactelecom.com Line: 6 Char: 1 Error: Object Expected Code: 0 [CODE] ?php require_once('Connections/mysql.php'); ? ?php // *** Validate request to login to this site. session_start(); $loginFormAction=$_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } [/CODE] Any help would be appreciated -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Getting error with IE
can you attach the file...hotmail always make a mess of the code bastien From: Vincent Lape [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: 'Bastien Koert' [EMAIL PROTECTED],php-db@lists.php.net Subject: RE: [PHP-DB] Getting error with IE Date: Tue, 16 Aug 2005 17:28:50 -0400 ?php require_once('Connections/mysql.php'); ? ?php // *** Validate request to login to this site. session_start(); $loginFormAction=$_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } if (isset($_POST['UserID'])) { $loginUsername=$_POST['UserID']; $password=$_POST['Passwd']; $MM_fldUserAuthorization = isauth; $MM_redirectLoginSuccess = ctc/index2.php; $MM_redirectLoginFailed = login_error.php; $MM_redirecttoReferrer = false; mysql_select_db($database_mysql, $mysql); $LoginRS__query=sprintf(SELECT username, password, isauth FROM webauth WHERE username='%s' AND password='%s', get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $mysql) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = mysql_result($LoginRS,0,'isauth'); //declare two session variables and assign them $GLOBALS['MM_Username'] = $loginUsername; $GLOBALS['MM_UserGroup'] = $loginStrGroup; //register the session variables session_register(MM_Username); session_register(MM_UserGroup); if (isset($_SESSION['PrevUrl']) false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header(Location: . $MM_redirectLoginSuccess ); } else { header(Location: . $MM_redirectLoginFailed ); } } ? html head titleCardiac Telecom Patient Information Login/title link REL=stylesheet TYPE=text/css HREF=file:///C|/Documents%20and%20Settings/vlape/My%20Documents/site_templa te/Webadmin/WinCss.css /HEAD BODY bgcolor=#FF onLoad=RunMe(); table width=90% border=0 cellspacing=0 cellpadding=3 align=center tr td center a href=index.phpimg src=content/logo.gif width=199 height=60 border=0/a form ACTION=?php echo $loginFormAction; ? method=POST name=LoginForm table width=63 border=0 cellspacing=0 cellpadding=3 align=center tr tdfont color=8F9CBCbfont size=2Username:/font/b/fontbr input type=text name=UserID class=txtbox /td /tr tr tdfont color=8F9CBCbfont size=2Password:/font/b/fontbr input type=password name=Passwd class=txtbox /td /tr tr td input type=image src=content/signin.gif width=64 height=18 name=image /td /tr /table /form /center /td /tr /table div align=centerfont size=1br a href=http://www.cardiactelecom.com; target=_blankbr Copyright copy; Cardiac Telecom Corporation /a/font/div /BODY /HTML -- Vincent Lape Systems Administrator, Cardiac Telecom Corporation. -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 5:04 PM To: [EMAIL PROTECTED]; php-db@lists.php.net Subject: RE: [PHP-DB] Getting error with IE Its a js error, post the complete page code/ js code for the page bastien From: Vincent Lape [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Getting error with IE Date: Tue, 16 Aug 2005 16:59:11 -0400 I am getting an error with IE when I load the page https://doctors.cardiactelecom.com Line: 6 Char: 1 Error: Object Expected Code: 0 [CODE] ?php require_once('Connections/mysql.php'); ? ?php // *** Validate request to login to this site. session_start(); $loginFormAction=$_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } [/CODE] Any help would be appreciated -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] session
In my php.ini I've enabled session.use_cookies=1 Everytime I initialize a session, it create the session storage file in my /tmp At the top my script, I've added session_start (); In my test login function, this was what I did: $_SESSION['username'] = 'abcdef'; session_set_cookie_params (time () + 3600); Whereas, in my logout function: unset ($_SESSION['username']); setcookie ('PHPSESSID', '', time () -1); Everytime I load this page, this is what it does: echo p{$_SESSION['username']}; Everytime load this page a session id is generated, which means, a session file name sess_current session_id is created, and my session variable $_SESSION['username'] get stored in there. Now, everytime I perform a logout, it creates a sess_session id file under /tmp, and when I perform a login again, it creates yet another sess_session id. I'm not exactly sure why does it do this. My intention is actually, to use register a session variable to denote login status, and session_set_cookie_params (); to set the expiry date for the cookie for my session. And every the page loads, to use session_get_cookie_params (); to check whether the cookie has expired, if it has, force for a new login (via redirect or link), if it hasn't expired, display the appropriate authenticated page content. Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: session
And I've forgot to mention the fact that my session_set_cookie_params (); even if I've supplies a url and a domain, e.g. $_SESSION['username'] = 'abc123'; session_set_cookie_params (time () + 3600, /myurl/, .mydomain.com); And with session_get_cookie_params (); I don't even get any values as for for lifetime, url and host. Regards and thank again. Shahmat Dahlan wrote: In my php.ini I've enabled session.use_cookies=1 Everytime I initialize a session, it create the session storage file in my /tmp At the top my script, I've added session_start (); In my test login function, this was what I did: $_SESSION['username'] = 'abcdef'; session_set_cookie_params (time () + 3600); Whereas, in my logout function: unset ($_SESSION['username']); setcookie ('PHPSESSID', '', time () -1); Everytime I load this page, this is what it does: echo p{$_SESSION['username']}; Everytime load this page a session id is generated, which means, a session file name sess_current session_id is created, and my session variable $_SESSION['username'] get stored in there. Now, everytime I perform a logout, it creates a sess_session id file under /tmp, and when I perform a login again, it creates yet another sess_session id. I'm not exactly sure why does it do this. My intention is actually, to use register a session variable to denote login status, and session_set_cookie_params (); to set the expiry date for the cookie for my session. And every the page loads, to use session_get_cookie_params (); to check whether the cookie has expired, if it has, force for a new login (via redirect or link), if it hasn't expired, display the appropriate authenticated page content. Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Problems getting data out from the database
I had try using the fetch arrays things or the fetch rows but it nv show anything out. The ans and info are two different table but in the same database. Below is the coding. ? $host='localhost'; $username='root'; $password='asd'; $connection = mysql_connect($host,$username,$password); mysql_select_db(testing); $ans = mysql_query (select ans.choice from ans, info where info.choice=ans.value;); $numOfRows = mysql_num_rows ($ans); $row = mysql_fetch_array($ans); echo $numOfRows br;//return num of rows echo $row[ans.choice]; ?
Re: [PHP-DB] Problems getting data out from the database
Do you get error messages? Try this: ? $host='localhost'; $username='root'; $password='asd'; $connection = mysql_connect($host,$username,$password) or die(mysql_error()); mysql_select_db(testing) or die(mysql_error()); $ans = mysql_query (select ans.choice from ans, info where info.choice=ans.value;) or die(mysql_error()); $numOfRows = mysql_num_rows ($ans); $row = mysql_fetch_array($ans); echo $numOfRows br;//return num of rows echo $row[ans.choice]; ? On Wednesday 17 August 2005 1:40 am, Chin Yan Yan wrote: I had try using the fetch arrays things or the fetch rows but it nv show anything out. The ans and info are two different table but in the same database. Below is the coding. ? $host='localhost'; $username='root'; $password='asd'; $connection = mysql_connect($host,$username,$password); mysql_select_db(testing); $ans = mysql_query (select ans.choice from ans, info where info.choice=ans.value;); $numOfRows = mysql_num_rows ($ans); $row = mysql_fetch_array($ans); echo $numOfRows br;//return num of rows echo $row[ans.choice]; ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Getting error with IE [[ SOLVED ]]
Thanks, the problem is solved. I forgot to remove an old ref to some JavaScript I decided not to use. Funny what a fresh set of eyes will do for something one has been staring at for hours :) Thanks again, Vinny -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php