Re: [PHP-DB] BLOB
i think this is the right sintax: SELECT * FROM `MEMBER` WHERE ISNULL(`PASSWD`) Passwd is a blob, that is an interesting name for a blob field, what are you planing to do? - Original Message - From: Ng Hwee Hwee [EMAIL PROTECTED] To: DBList [EMAIL PROTECTED] Sent: Friday, March 12, 2004 4:39 AM Subject: [PHP-DB] BLOB Hi all, how do i find out if a BLOB field in my table is NULL? i tried: SELECT * FROM `MEMBER` WHERE `PASSWD` is NULL however, although there is one entry in my table that has nothing in my PASSWD field, the result set is empty.. how come? how do i search for entries that has password = [BLOB - 0 bytes] ?? thanx so much!! huihui -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP - MSSQL connects, but can't query
I've got a very simple PHP script for testing my MS SQL Server connection. I've installed FreeTDS and I can connect and query the database with TSQL. With PHP I can connect and disconnect properly but I can't query or attach to different databases. Here is my sample PHP followed by what the web server throws back at me: sql-test.php html body bgcolor=white ?php $dbproc = mssql_connect(roger,sa,admin); #$dbproc = sybase_connect(roger,sa,admin); if (! $dbproc) { print Can't connect to server; return; } print Connected to server.; $dbconnect = mssql_select_db(Northwind); if (! $dbconnect) { print Can't connect to Northwind; return; } print Connected to database; #$res = sybase_query(select * from test,$dbproc); #if (! $res) { # return; #} #while ($arr = sybase_fetch_array($res)) { # print $arr[i] . . $arr[v] . br\n; #} if (! mssql_close($dbproc)) { print Can't close server connection; return; } print Connection closed.; ? /body /html Output in browser when referencing the sql-test.php file: - Connected to server. Warning: Sybase: Server message: Line 1: Incorrect syntax near 'e'. (severity 15, procedure N/A) in /home/www/sql-test.php on line 12 Can't connect to Northwind Can anyone help me figure this one out?! Thanks! Jason Morrill IT Manager Child Family Agency SE Connecticut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP - MSSQL connects, but can't query
Hmm, replace the line where you select the DB with: $dbconnect = mssql_select_db(Northwind) or die(mssql_get_last_message()); (All on one line incase the email wraps it.) On Fri, 2004-03-12 at 08:35, Jason Morrill wrote: I've got a very simple PHP script for testing my MS SQL Server connection. I've installed FreeTDS and I can connect and query the database with TSQL. With PHP I can connect and disconnect properly but I can't query or attach to different databases. Here is my sample PHP followed by what the web server throws back at me: sql-test.php html body bgcolor=white ?php $dbproc = mssql_connect(roger,sa,admin); #$dbproc = sybase_connect(roger,sa,admin); if (! $dbproc) { print Can't connect to server; return; } print Connected to server.; $dbconnect = mssql_select_db(Northwind); if (! $dbconnect) { print Can't connect to Northwind; return; } print Connected to database; #$res = sybase_query(select * from test,$dbproc); #if (! $res) { # return; #} #while ($arr = sybase_fetch_array($res)) { # print $arr[i] . . $arr[v] . br\n; #} if (! mssql_close($dbproc)) { print Can't close server connection; return; } print Connection closed.; ? /body /html Output in browser when referencing the sql-test.php file: - Connected to server. Warning: Sybase: Server message: Line 1: Incorrect syntax near 'e'. (severity 15, procedure N/A) in /home/www/sql-test.php on line 12 Can't connect to Northwind Can anyone help me figure this one out?! Thanks! Jason Morrill IT Manager Child Family Agency SE Connecticut -- Adam Voigt [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC support
Hi Mark An alternative solution for connecting to MS Access is odbtp. Details are available at http://odbtp.sourceforge.net. It provides better support for ODBC, especially in regards to MS Access. Take a look at the storedqry.php example at http://odbtp.sourceforge.net/examples.html. It shows how to execute a MS Access stored query. The odbtp extension has a higher performance, and it allows you to remotely connect to your Access database from any platform. -- bob On Thu, 11 Mar 2004, Galbreath, Mark A wrote: Yes, I'm a newbie to PHP, but I got a phpBB2 BBS online in a day and I'm psyched. My problem is, the PHP docs and API mention that ODBC is built into PHP 4.x but I can't figure out how to use it. I would like to access the M$ Access JET engine directly from a PHP page. Any clues? tia, Mark -- 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] ODBC support
This looks really great, Bob...thx! Mark -Original Message- From: Robert Twitty [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 10:19 AM To: Galbreath, Mark A Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DB] ODBC support Hi Mark An alternative solution for connecting to MS Access is odbtp. Details are available at http://odbtp.sourceforge.net. It provides better support for ODBC, especially in regards to MS Access. Take a look at the storedqry.php example at http://odbtp.sourceforge.net/examples.html. It shows how to execute a MS Access stored query. The odbtp extension has a higher performance, and it allows you to remotely connect to your Access database from any platform. -- bob On Thu, 11 Mar 2004, Galbreath, Mark A wrote: Yes, I'm a newbie to PHP, but I got a phpBB2 BBS online in a day and I'm psyched. My problem is, the PHP docs and API mention that ODBC is built into PHP 4.x but I can't figure out how to use it. I would like to access the M$ Access JET engine directly from a PHP page. Any clues? tia, Mark -- 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] Impact of MySQL Queries
I'm working on a forum. When it displays a forum index, it gets all the topics and depending on the offset, displays only ten at a time. Now that's a single query. But problem comes when I display how many replies each post has. So far, when it does the while loop, it does a query for each item. Here's the code: $indexresult = mysql_query(SELECT uid,userpost,datetime,body,head,editdatetime,edituserpost, sticky,room,locked,lastpostdate,lastpostuser FROM orinsbox.forumposts WHERE ROOM = '.$_GET['room'].' AND .filter($filter). ORDER BY .sortby($sortby).) $while_offset = 0; // This is the counter used to check what post the while loop is on $while_count = 1; // This is how many posts have been displayed (once it has reached the offset) // Print out posts while ($row = mysql_fetch_assoc($indexresult)) // Run through all the posts { $while_offset++; if ($while_offset $offset AND $while_count = 10){ // if the post is in the range $while_count++; // Get num of replies $repliesresult = mysql_query(SELECT uid FROM orinsbox.forumposts WHERE common = '.$row[uid].') or die (Unable to run query, YOU SUCK: .mysql_error()); $replies = mysql_num_rows($repliesresult); // This is setting the image to be used for the post if($row[locked] != NULL AND $row[sticky] != NULL ){$icon = img src=\images/gold_lock.gif\ width=\18\ height=\24\ title=\Locked and Sticky\;} elseif($row[locked] != NULL AND $row[sticky] == NULL ){$icon = img src=\images/silver_lock.gif\ width=\18\ height=\24\ title=\Locked\;} elseif($row[locked] == NULL AND $row[sticky] != NULL ){$icon = img src=\images/gold_nugget.gif\ width=\18\ height=\24\ title=\Sticky\;} else {$icon = NULL;} // $row[descrip] if (!isset($bgcolour) OR $bgcolour == FF){$bgcolour = EE;}else{$bgcolour = FF;} // For alternating backround colours of the cells if (!isset($row[common]) OR $row[common] == NULL){ echo tr bgcolor=\#.$bgcolour.\ height=24; echo td width=\18\.$icon./td tda href=forums.php?room=.urlencode($_GET['room']).doForums=viewtopicobject=.$row[uid].offset=.$offset..$row[head]./a/td td.ucwords($row[userpost])./tdtd.$replies./td tdOn .$row[lastpostdate]; if ($row[lastpostuser] != NULL){ by .$row[lastpostuser];} echo /td; echo /tr;} } else {// Don't post it } } The 'uid' column is the unique number of the post. All posts have this. Now the column called 'common' is for replies. Posts that are to appear in the forum index don't have a 'common' set. If it is a reply, the column 'common' is set to the uid of the post it is a reply too. Example: Post 1: Subject: Hey all how do I do this UID: marforu200401F COMMON: NULL Post 2: Subject: Hey this is how you do it! UID: jayforu200404A COMMON: marforu200401F Is there an easier way to do this, maybe with a sub select statement maybe? I only know basic mysql. I hope this is understandable... Oh yeah, you might wonder why I use the custom offset instead of using the LIMIT and OFFSET clauses in the main MySQL query. The problem with this is that when I order the posts, it would only order them by the one gotten, not them all, which is what I wanted. -- Marcjon -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Accessing MS SQL from Linux
My domain is hosting through a hosting company on Linux with PHP 4.3.4. Hosting company is not open to re-compile PHP for using FreeTDS or any other application. If I can not use FreeTDS, what other options do I have? a) Can Pear be used? It is 4.3.4. I tried ?php required_once(DB.php) ? but got error. b) Can ADODB be used without re-compiling PHP? Any other option? Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Impact of MySQL Queries
Marcjon, I think you have asked this question before. there are replies to it, have you checked those? Marcjon Louwersheimer wrote: I'm working on a forum. When it displays a forum index, it gets all the topics and depending on the offset, displays only ten at a time. Now that's a single query. But problem comes when I display how many replies each post has. So far, when it does the while loop, it does a query for each item. Here's the code: ... while ($row = mysql_fetch_assoc($indexresult)) // Run through all the posts { $while_offset++; if ($while_offset $offset AND $while_count = 10){ // if the post is in the range $while_count++; this would mean you fetch the whole result (not just 10 lines) and loop over all of it. it would be much better to make use of the mySQL syntax: [LIMIT [offset,] row_count | row_count OFFSET offset] see: http://www.mysql.com/doc/en/SELECT.html free advice: take the time to read manuals even if your not stuck on a particular problem, you often come across solutions to problems you haven't encountered yet! if you're serious about PHP and mySQL then reading both manuals back2front will save you time in the long run + open your eyes to a whole lot of stuff - if you don't understand something, skip it and move on - something you read later will probably help to explain it. ... Is there an easier way to do this, maybe with a sub select statement yes. maybe? I only know basic mysql. I hope this is understandable... subselects are available in mySQL 4 I believe (don't hold me to it)... my current DB preference goes to Firebird 1.5 Oh yeah, you might wonder why I use the custom offset instead of using the LIMIT and OFFSET clauses in the main MySQL query. The problem with this is that when I order the posts, it would only order them by the one gotten, not them all, which is what I wanted. which is the same thing, assuming you are using the same ORDER BY clause. ok, so in one case the result set doesn't contain certain rows but these are the rows that you wouldn't show anyway. your original question about minimizing the number of SQL queries is answered in the reply(s?) to one of your other posts. subject= Re: [PHP-DB] Forum Script date = 3/7/2004 9:23 PM (god knows how accurate that is) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Accessing MS SQL from Linux
You need one ofe the folowing extensions compied as a shared or static module: ODBC (UnixODBC) MSSQL (FreeTDS) ODBTP compiling as a shered module does not require recompile of PHP. You just need to load the extension with dl() or from php.ini. - Frank My domain is hosting through a hosting company on Linux with PHP 4.3.4. Hosting company is not open to re-compile PHP for using FreeTDS or any other application. If I can not use FreeTDS, what other options do I have? a) Can Pear be used? It is 4.3.4. I tried ?php required_once(DB.php) ? but got error. b) Can ADODB be used without re-compiling PHP? Any other option? Thanks -- 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] Accessing MS SQL from Linux
Is the machine running SQL Server also hosted by the same company? Is it possible to use PHP on a Win32 machine so that you can use the php_mssql.dll extension? -- bob On Fri, 12 Mar 2004, S K Rana wrote: My domain is hosting through a hosting company on Linux with PHP 4.3.4. Hosting company is not open to re-compile PHP for using FreeTDS or any other application. If I can not use FreeTDS, what other options do I have? a) Can Pear be used? It is 4.3.4. I tried ?php required_once(DB.php) ? but got error. b) Can ADODB be used without re-compiling PHP? Any other option? Thanks -- 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] Inserting Data in Multiple Tables - MySQL
Is it possible to write one INSERT statement to populate multiple tables? __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimb.net _ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How to redirect after a valid login
Is there a way that after a execution of a Login script and validation of login from a MySql database to automatically redirected to run another script ? example someone logs in through the login.php script, in the login script you are validated and then you run another script called mainmenu.php ? I have tried the following: include mainmenu.php; // Which gives me an error ! This one just put the link on the page and does not redirect to another script. echo header(Location: a href=http://www.example.com/InVocie/MainMenu.php); ' target='_blank'http://www.example.com/InVoice/MainMenu.php?r=$a);/a; /* Redirect browser */ Larry Sandwick Sarreid, Ltd. Network/System Administrator phone: (252) 291-1414 x223 fax : (252) 237-1592
Re: [PHP-DB] How to redirect after a valid login
Is there a way that after a execution of a Login script and validation of login from a MySql database to automatically redirected to run another script ? Use PHP's header() function. See the manual for syntax. Larry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Using Array with form submission
I have been trying to get this to work and think I must be missing something. I am using Kevin Yank's books and examples as a guide. Here is what I have so far - this does work [as it should since Kevin created it.. 8-) ] I have a form that creates a list of items with a select link that when clicked adds the selected item to a shopping cart. I would like to convert this to a checkbox model. Here is what I have so far = ? /* Check User Script */ session_start(); // Start Session if (!isset($_SESSION['cart'])) $_SESSION['cart'] = array(); if (isset($_GET['Select'])) { // Add item to the end of the $_SESSION['cart'] array $_SESSION['cart'][] = $_GET['Select']; header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID); exit(); } include(connects to dB); $Info = mysql_query(SELECT the data); $rows = mysql_num_rows($Info); $oldCat=; // Will give you the number of rows returned from the SELECT statement // echo($rows); for($i = 0; $i $rows; $i++) { $SRecord = mysql_fetch_array($Info, MYSQL_ASSOC); $ItemID[] = htmlspecialchars($SRecord[ItemID]); $CatID[] = htmlspecialchars($SRecord[CatID]); $Category[] = htmlspecialchars($SRecord[ProdCategory]); $Model[] = htmlspecialchars($SRecord[ItemModel]); $Description[] = htmlspecialchars($SRecord[ItemDescription]); $Price[] = htmlspecialchars($SRecord[ItemPrice]); { IF ($oldCat != $Category[$i] ) { echo(table cellspacing=2 cellpadding=2 border=1 width=700); echo(tr); echo(tr/trcenterfont face=Arial size=-1bCategory:nbsp;nbsp;/b/font); echo(font face=Arial size=-1b$Category[$i]/b/font/center/tr); $oldCat=$Category[$i]; } echo(/tr); } ? tr Tdfont face=Arial size=-1 ? echo('tda href=' . $_SERVER['PHP_SELF'] .'?Select=' . $i . 'Select/a/td');? //Change this out to a checkbox Tdfont face=Arial size=-1? echo ($CatID[$i]); ?/FONT/A/td tdfont face=Arial size=-1? echo($Model[$i]); ?/font/td tdfont face=Arial size=-1? echo($Description[$i]); ?/font/td tdfont face=Arial size=-1$? echo (number_format($Price[$i],2)); ?/font/td ? } ? I want to change the Select statement above to ? echo (input type='checkbox' name='select[]' value='$ItemID[$i]' . $ItemID[$i]); ?/FONT/A/td but can't seem to make the addition to the cart work. Any idea how to change the Select to a check box and have it loop threw the array so that each selected item is added to the shopping cart?? Thanks in advance for all your help.. Aleks
[PHP-DB] Using Array with form submission
Sorry for all the dead space in my last post... I cleaned it up some here... === I have been trying to get this to work and think I must be missing something. I am using Kevin Yank's books and examples as a guide. Here is what I have so far - this does work [as it should since Kevin created it.. 8-) ] I have a form that creates a list of items with a select link that when clicked adds the selected item to a shopping cart. I would like to convert this to a checkbox model. Here is what I have so far = ? /* Check User Script */ session_start(); // Start Session if (!isset($_SESSION['cart'])) $_SESSION['cart'] = array(); if (isset($_GET['Select'])) { // Add item to the end of the $_SESSION['cart'] array $_SESSION['cart'][] = $_GET['Select']; header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID); exit(); } include(connects to dB); $Info = mysql_query(SELECT the data); $rows = mysql_num_rows($Info); $oldCat=; // Will give you the number of rows returned from the SELECT statement // echo($rows); for($i = 0; $i $rows; $i++) { $SRecord = mysql_fetch_array($Info, MYSQL_ASSOC); $ItemID[] = htmlspecialchars($SRecord[ItemID]); $CatID[] = htmlspecialchars($SRecord[CatID]); $Category[] = htmlspecialchars($SRecord[ProdCategory]); $Model[] = htmlspecialchars($SRecord[ItemModel]); $Description[] = htmlspecialchars($SRecord[ItemDescription]); $Price[] = htmlspecialchars($SRecord[ItemPrice]); { IF ($oldCat != $Category[$i] ) { echo(table cellspacing=2 cellpadding=2 border=1 width=700); echo(tr); echo(tr/trcenterfont face=Arial size=-1bCategory:nbsp;nbsp;/b/font); echo(font face=Arial size=-1b$Category[$i]/b/font/center/tr); $oldCat=$Category[$i]; } echo(/tr); } ? tr Tdfont face=Arial size=-1 ? echo('tda href=' . $_SERVER['PHP_SELF'] .'?Select=' . $i . 'Select/a/td');? //Change this out to a checkbox Tdfont face=Arial size=-1? echo ($CatID[$i]); ?/FONT/A/td tdfont face=Arial size=-1? echo($Model[$i]); ?/font/td tdfont face=Arial size=-1? echo($Description[$i]); ?/font/td tdfont face=Arial size=-1$? echo (number_format($Price[$i],2)); ?/font/td ? } ? I want to change the Select statement above to ? echo (input type='checkbox' name='select[]' value='$ItemID[$i]' . $ItemID[$i]); ?/FONT/A/td but can't seem to make the addition to the cart work. Any idea how to change the Select to a check box and have it loop threw the array so that each selected item is added to the shopping cart?? Once I have The cart working I will be submitting the complete cart into a MySQL dB Thanks in advance for all your help.. Aleks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] How to redirect after a valid login
What is considered to be the headers() information When I use the header() functions, I get an error stating that I have already sent the headers information? // Larry -Original Message- From: Larry E. Ullman [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:04 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] How to redirect after a valid login Is there a way that after a execution of a Login script and validation of login from a MySql database to automatically redirected to run another script ? Use PHP's header() function. See the manual for syntax. Larry -- 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] How to redirect after a valid login
That means you send some output before the headers were sent. That is a no no. For instance, this will not work: ?php Echo hello world; header(Location:http://www.yahoo.com/;); ? But this will ?php header(Location:http://www.yahoo.com/;); Echo hello world; ? - Paul -Original Message- From: Larry Sandwick [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:25 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] How to redirect after a valid login What is considered to be the headers() information When I use the header() functions, I get an error stating that I have already sent the headers information? // Larry -Original Message- From: Larry E. Ullman [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:04 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] How to redirect after a valid login Is there a way that after a execution of a Login script and validation of login from a MySql database to automatically redirected to run another script ? Use PHP's header() function. See the manual for syntax. Larry -- 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
Re: [PHP-DB] How to redirect after a valid login
You can do a redirect at any point in your code as long as you haven't sent anything to the browser yet. You can run 10,000 lines of PHP code and do 1,000 queries and still send a redirect to the browser. In a nut shell, have no echo statement before your redirect. On Mar 12, 2004, at 3:02 PM, Larry Sandwick wrote: Is there a way that after a execution of a Login script and validation of login from a MySql database to automatically redirected to run another script ? example someone logs in through the login.php script, in the login script you are validated and then you run another script called mainmenu.php ? I have tried the following: include mainmenu.php; // Which gives me an error ! This one just put the link on the page and does not redirect to another script. echo header(Location: a href=http://www.example.com/InVocie/MainMenu.php); ' target='_blank'http://www.example.com/InVoice/MainMenu.php?r=$a);/ a; /* Redirect browser */ Larry Sandwick Sarreid, Ltd. Network/System Administrator phone: (252) 291-1414 x223 fax : (252) 237-1592 -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ldap_connect() version
Does anyone know what version of php that ldap_connect() was released with? It works on version 4.3.0 on this one server, but it does not work on 4.2.3 on a different server? If it is supposed to work on 4.2.3, any suggestions on why it's not recognizing it as a valid function? Philip Thompson When you least expect it... expect it! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] How to redirect after a valid login
Not to mention, the header() statement is being used incorrectly in the example code. You don't echo out the header() statement. You simply use it. For example... ?php include(whateveryouwant.inc);//as long as the .inc does not output to browser ...BUNCHA' PHP STUFF, BUT NO ECHO STATEMENTS... header(Location:www.example.com); ? In your sample code, you include(mainmenu.php) which looks like it would output to the browser. You can't to that on the same page you use header(). HTH, Rich -Original Message- From: Brent Baisley [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 4:12 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] How to redirect after a valid login You can do a redirect at any point in your code as long as you haven't sent anything to the browser yet. You can run 10,000 lines of PHP code and do 1,000 queries and still send a redirect to the browser. In a nut shell, have no echo statement before your redirect. On Mar 12, 2004, at 3:02 PM, Larry Sandwick wrote: Is there a way that after a execution of a Login script and validation of login from a MySql database to automatically redirected to run another script ? example someone logs in through the login.php script, in the login script you are validated and then you run another script called mainmenu.php ? I have tried the following: include mainmenu.php; // Which gives me an error ! This one just put the link on the page and does not redirect to another script. echo header(Location: a href=http://www.example.com/InVocie/MainMenu.php); ' target='_blank'http://www.example.com/InVoice/MainMenu.php?r=$a);/ a; /* Redirect browser */ Larry Sandwick Sarreid, Ltd. Network/System Administrator phone: (252) 291-1414 x223 fax : (252) 237-1592 -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- 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] Inserting Data in Multiple Tables.. again
Here is the problem I am experiencing: I have a form that collects data and I would like it to send it to three tables in a MySQL DB. One table is called TRAININGLOG , other is called CORE and the third is USERS. The USER table is the main table that contains the primary key. My question is, what is the correct way for handling something like this? Do I need to write three separate queries (INSERT) statements? I am using MySQL 4.0.17 if that helps? Thanks in advance, Craig __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimb.net _ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] fw:¤£°eªáªº²z¥Ñ.
[EMAIL PROTECTED] .. . 1. 2.() 3.[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php