[PHP] Create table .. script
Hello When I need to create table I have to login into mysql and run the query. Is there a way to create some sort of scipt that can create all my tables?.So If I need create a table in new database I just run the script. I know that I can do mysql_query(QUERY OF TABLE); But is there another way of doing this? Thanks _ One-click access to Hotmail from any Web page download MSN Toolbar now! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table .. script
On Mar 13, 2004, at 5:24 PM, Mike Mapsnac wrote: Hello When I need to create table I have to login into mysql and run the query. Is there a way to create some sort of scipt that can create all my tables?.So If I need create a table in new database I just run the script. I know that I can do mysql_query(QUERY OF TABLE); But is there another way of doing this? $sql = CREATE TABLE `rss_cat` ( `id` int(11) NOT NULL auto_increment, `cat` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=1; mysql_query($sql); Just use general SQL to create tables in PHP. This isn't the correct list for these kind of questions, since we have php-db for database related stuff. Regards, Filip de Waard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table .. script[via LSMTP - see www.lsoft.com]
Hi Mike, Try using phpMyAdmin, but sorry I forgot the site :( try google. Regards, Firman - Original Message - From: Mike Mapsnac [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 13, 2004 11:24 PM Subject: [PHP] Create table .. script Hello When I need to create table I have to login into mysql and run the query. Is there a way to create some sort of scipt that can create all my tables?.So If I need create a table in new database I just run the script. I know that I can do mysql_query(QUERY OF TABLE); But is there another way of doing this? Thanks _ One-click access to Hotmail from any Web page - download MSN Toolbar now! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create table with varying results
I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red background color and if the same exact search is run again it will display properly. If I have a search with large number of records (few thousand) there is usually html text printed above the table of results. If I perform the exact search multiple times, I will get different html text printed above the table. It seems as if the PHP engine/interpretor is not processing the script properly. I would think if I had a syntax issue with the script or HTML it would either error out or return the same results everytime. Has anyone else seen this problem before? w2k SP2 IIS PHP 4.2.1 Thanks for the help. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table with varying results
Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red background color and if the same exact search is run again it will display properly. If I have a search with large number of records (few thousand) there is usually html text printed above the table of results. If I perform the exact search multiple times, I will get different html text printed above the table. It seems as if the PHP engine/interpretor is not processing the script properly. I would think if I had a syntax issue with the script or HTML it would either error out or return the same results everytime. Has anyone else seen this problem before? w2k SP2 IIS PHP 4.2.1 Thanks for the help. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table with varying results
The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha-numeric. Still have the same problem. Very strange. Tim Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red background color and if the same exact search is run again it will display properly. If I have a search with large number of records (few thousand) there is usually html text printed above the table of results. If I perform the exact search multiple times, I will get different html text printed above the table. It seems as if the PHP engine/interpretor is not processing the script properly. I would think if I had a syntax issue with the script or HTML it would either error out or return the same results everytime. Has anyone else seen this problem before? w2k SP2 IIS PHP 4.2.1 Thanks for the help. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table with varying results
What is the specific nature of the errors in the HTML? Are random characters missing/inserted, or does it look like something that could happen as a result of unexpected program behavior at a higher level? miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha-numeric. Still have the same problem. Very strange. Tim Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red background color and if the same exact search is run again it will display properly. If I have a search with large number of records (few thousand) there is usually html text printed above the table of results. If I perform the exact search multiple times, I will get different html text printed above the table. It seems as if the PHP engine/interpretor is not processing the script properly. I would think if I had a syntax issue with the script or HTML it would either error out or return the same results everytime. Has anyone else seen this problem before? w2k SP2 IIS PHP 4.2.1 Thanks for the help. Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table with varying results
Hi Miguel, The errors appear to be the result of strings not terminating properly from the PHP output. Then partial HTML code is inserted in cells or at the top of the table. I have stripped everything out and am now just creating a loop to build a table and still get the same errors. I have checked it with IE 5.5, IE 6, NS 4.78 and NS6.2.2 all with the same type of errors. Here is a link to the page that creates the table: http://www.coloradowinware.com/sample/error/sample.php Depending on your connection speed it may take a few seconds, it is generating 650 rows. You may need to refresh a couple of times to see the errors. Some times there is text printed above the table and sometimes there is partial html in table cells and other times there may be colored cells. Here is the source for the page: Thanks for your help. HTML HEAD TITLEPHP Test/TITLE /HEAD body ?php buildtable() ? ?php function buildtable() { //print header row print table border='2' cellspacing='0' bordercolor='#C0C0C0' width='97%' id='AutoNumber2' style='border-collapse: collapse' bgcolor='#FF'; print tr; print td width='4%' align='center' bgcolor='#FFCC00'nbsp;/td; print td width='28%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Name/font/b/td; print td width='13%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Phone/font/b/td; print td width='29%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'E-Mail/font/b/td; print td width='22%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Department/font/b/td; print td width='4%' bgcolor='#FFCC00'nbsp;/td; print /tr; //end print header row $i=0; $number = 650; while ($i $number) : $name = Fred Flintstone; $email = My Mail; $department = Department; print tr; print td width='4%' align='center' bgcolor='#FF'p align='center' bgcolor='#FF'font size='1' face='Verdana' . $i . /font/td; print td width='28%' bgcolor='#FF'font size='1' face='Verdana'fred/font/td; print td width='13%' bgcolor='#FF'font size='1' face='Verdana'255-3698/font/td; print td width='29%' bgcolor='#FF'a href=mailto:[EMAIL PROTECTED]font size='1' face='Verdana'fred/font/a/td; print td width='22%' bgcolor='#FF'font size='1' face='Verdana'department/font/td; print td width='4%' bgcolor='#FF'nbsp;/td; print /tr; $i++; endwhile; // close table print /table; return; } ? /body /html Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What is the specific nature of the errors in the HTML? Are random characters missing/inserted, or does it look like something that could happen as a result of unexpected program behavior at a higher level? miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha-numeric. Still have the same problem. Very strange. Tim Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red background color and if the same exact search is run again it will display properly. If I have a search with large number of records (few thousand) there is usually html text printed above the table of results. If I perform the exact search multiple times, I will get different html text printed above the table. It seems as if the PHP engine/interpretor is not processing the script properly. I would think if I had a syntax issue with the script or HTML it would either error out or return the same results everytime. Has anyone else seen this problem before? w2k SP2 IIS PHP 4.2.1 Thanks for the help. Tim -- PHP General Mailing List (http://www.php.net/) To
RE: [PHP] Create table with varying results
I looked at it and hit refresh a few times and never saw anything odd. IE 6.0 on Win2K Most of the time if a table is messing up, it's because things are being put between the td or tr tags. What the browser will usually do is take all of that stuff that's between the tags, which it can't display there, and put it all at the beginning of the table. Look for anything like that. ---John Holmes... -Original Message- From: Tim Greenleaf [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 6:03 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Create table with varying results Hi Miguel, The errors appear to be the result of strings not terminating properly from the PHP output. Then partial HTML code is inserted in cells or at the top of the table. I have stripped everything out and am now just creating a loop to build a table and still get the same errors. I have checked it with IE 5.5, IE 6, NS 4.78 and NS6.2.2 all with the same type of errors. Here is a link to the page that creates the table: http://www.coloradowinware.com/sample/error/sample.php Depending on your connection speed it may take a few seconds, it is generating 650 rows. You may need to refresh a couple of times to see the errors. Some times there is text printed above the table and sometimes there is partial html in table cells and other times there may be colored cells. Here is the source for the page: Thanks for your help. HTML HEAD TITLEPHP Test/TITLE /HEAD body ?php buildtable() ? ?php function buildtable() { //print header row print table border='2' cellspacing='0' bordercolor='#C0C0C0' width='97%' id='AutoNumber2' style='border-collapse: collapse' bgcolor='#FF'; print tr; print td width='4%' align='center' bgcolor='#FFCC00'nbsp;/td; print td width='28%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Name/font/b/td; print td width='13%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Phone/font/b/td; print td width='29%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'E-Mail/font/b/td; print td width='22%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Department/font/b/td; print td width='4%' bgcolor='#FFCC00'nbsp;/td; print /tr; //end print header row $i=0; $number = 650; while ($i $number) : $name = Fred Flintstone; $email = My Mail; $department = Department; print tr; print td width='4%' align='center' bgcolor='#FF'p align='center' bgcolor='#FF'font size='1' face='Verdana' . $i . /font/td; print td width='28%' bgcolor='#FF'font size='1' face='Verdana'fred/font/td; print td width='13%' bgcolor='#FF'font size='1' face='Verdana'255-3698/font/td; print td width='29%' bgcolor='#FF'a href=mailto:[EMAIL PROTECTED]font size='1' face='Verdana'fred/font/a/td; print td width='22%' bgcolor='#FF'font size='1' face='Verdana'department/font/td; print td width='4%' bgcolor='#FF'nbsp;/td; print /tr; $i++; endwhile; // close table print /table; return; } ? /body /html Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What is the specific nature of the errors in the HTML? Are random characters missing/inserted, or does it look like something that could happen as a result of unexpected program behavior at a higher level? miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha- numeric. Still have the same problem. Very strange. Tim Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red
Re: [PHP] Create table with varying results
Like John, I tried several times (both Mac and Windows IE) and never got anything funny. How many times do you usually have to refresh before you see the problem? (I think I viewed it 4 times). miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The errors appear to be the result of strings not terminating properly from the PHP output. Then partial HTML code is inserted in cells or at the top of the table. I have stripped everything out and am now just creating a loop to build a table and still get the same errors. I have checked it with IE 5.5, IE 6, NS 4.78 and NS6.2.2 all with the same type of errors. Here is a link to the page that creates the table: http://www.coloradowinware.com/sample/error/sample.php Depending on your connection speed it may take a few seconds, it is generating 650 rows. You may need to refresh a couple of times to see the errors. Some times there is text printed above the table and sometimes there is partial html in table cells and other times there may be colored cells. Here is the source for the page: Thanks for your help. HTML HEAD TITLEPHP Test/TITLE /HEAD body ?php buildtable() ? ?php function buildtable() { //print header row print table border='2' cellspacing='0' bordercolor='#C0C0C0' width='97%' id='AutoNumber2' style='border-collapse: collapse' bgcolor='#FF'; print tr; print td width='4%' align='center' bgcolor='#FFCC00'nbsp;/td; print td width='28%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Name/font/b/td; print td width='13%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Phone/font/b/td; print td width='29%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'E-Mail/font/b/td; print td width='22%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Department/font/b/td; print td width='4%' bgcolor='#FFCC00'nbsp;/td; print /tr; //end print header row $i=0; $number = 650; while ($i $number) : $name = Fred Flintstone; $email = My Mail; $department = Department; print tr; print td width='4%' align='center' bgcolor='#FF'p align='center' bgcolor='#FF'font size='1' face='Verdana' . $i . /font/td; print td width='28%' bgcolor='#FF'font size='1' face='Verdana'fred/font/td; print td width='13%' bgcolor='#FF'font size='1' face='Verdana'255-3698/font/td; print td width='29%' bgcolor='#FF'a href=mailto:[EMAIL PROTECTED]font size='1' face='Verdana'fred/font/a/td; print td width='22%' bgcolor='#FF'font size='1' face='Verdana'department/font/td; print td width='4%' bgcolor='#FF'nbsp;/td; print /tr; $i++; endwhile; // close table print /table; return; } ? /body /html Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What is the specific nature of the errors in the HTML? Are random characters missing/inserted, or does it look like something that could happen as a result of unexpected program behavior at a higher level? miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha-numeric. Still have the same problem. Very strange. Tim Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. Sometimes a field may have a black or red background color and if the same exact search is run again it will display properly. If I have a search with large number of records (few thousand) there is usually html text printed above the table of results. If I perform the exact search multiple times, I will get different html text printed above the table. It seems as if the PHP engine/interpretor is
Re: [PHP] Create table with varying results
Hi Miguel, Thanks for looking. It may take three or four times at most. I don't know if you scrolled the table each time but it is random and sometimes not apparent but here is the contents of an e-mail address cell at line 433. fredded width='22%' bgcolor='#FF'department Other e-mail cells have department it them. I have tried on two different w2k machines with IE and Netscape. Thanks anyway. Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Like John, I tried several times (both Mac and Windows IE) and never got anything funny. How many times do you usually have to refresh before you see the problem? (I think I viewed it 4 times). miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The errors appear to be the result of strings not terminating properly from the PHP output. Then partial HTML code is inserted in cells or at the top of the table. I have stripped everything out and am now just creating a loop to build a table and still get the same errors. I have checked it with IE 5.5, IE 6, NS 4.78 and NS6.2.2 all with the same type of errors. Here is a link to the page that creates the table: http://www.coloradowinware.com/sample/error/sample.php Depending on your connection speed it may take a few seconds, it is generating 650 rows. You may need to refresh a couple of times to see the errors. Some times there is text printed above the table and sometimes there is partial html in table cells and other times there may be colored cells. Here is the source for the page: Thanks for your help. HTML HEAD TITLEPHP Test/TITLE /HEAD body ?php buildtable() ? ?php function buildtable() { //print header row print table border='2' cellspacing='0' bordercolor='#C0C0C0' width='97%' id='AutoNumber2' style='border-collapse: collapse' bgcolor='#FF'; print tr; print td width='4%' align='center' bgcolor='#FFCC00'nbsp;/td; print td width='28%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Name/font/b/td; print td width='13%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Phone/font/b/td; print td width='29%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'E-Mail/font/b/td; print td width='22%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Department/font/b/td; print td width='4%' bgcolor='#FFCC00'nbsp;/td; print /tr; //end print header row $i=0; $number = 650; while ($i $number) : $name = Fred Flintstone; $email = My Mail; $department = Department; print tr; print td width='4%' align='center' bgcolor='#FF'p align='center' bgcolor='#FF'font size='1' face='Verdana' . $i . /font/td; print td width='28%' bgcolor='#FF'font size='1' face='Verdana'fred/font/td; print td width='13%' bgcolor='#FF'font size='1' face='Verdana'255-3698/font/td; print td width='29%' bgcolor='#FF'a href=mailto:[EMAIL PROTECTED]font size='1' face='Verdana'fred/font/a/td; print td width='22%' bgcolor='#FF'font size='1' face='Verdana'department/font/td; print td width='4%' bgcolor='#FF'nbsp;/td; print /tr; $i++; endwhile; // close table print /table; return; } ? /body /html Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What is the specific nature of the errors in the HTML? Are random characters missing/inserted, or does it look like something that could happen as a result of unexpected program behavior at a higher level? miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha-numeric. Still have the same problem. Very strange. Tim Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you using Internet Explorer for Windows to view the HTML? It has some rendering problems with complex tables that result in very erratic behavior in certain circumstances (which I have yet to understand). View the page in another browser, or better yet, view the source code. That's a better way to determine whether or not your program is generating the correct data. miguel On Thu, 23 May 2002, Tim Greenleaf wrote: I have a search page
RE: [PHP] Create table with varying results
Tim, I had a look in both IE first it showed the table fine even after refreshing 4 or 5 times scrolling down, there was a script exicution error (script look longer than 30 secs) then loaded it in Netscape and table didn't show at all... I'd try initally just grabbing the table part and getting that happening with just pure html with some data in manually put in there .. I'd try to get the table lay out right before including php I had a similar problem and found was because it didn't like the html out put was being sent by php. cheers Peter -Original Message- From: Tim Greenleaf [mailto:[EMAIL PROTECTED]] Sent: Friday, 24 May 2002 9:00 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Create table with varying results Hi Miguel, Thanks for looking. It may take three or four times at most. I don't know if you scrolled the table each time but it is random and sometimes not apparent but here is the contents of an e-mail address cell at line 433. fredded width='22%' bgcolor='#FF'department Other e-mail cells have department it them. I have tried on two different w2k machines with IE and Netscape. Thanks anyway. Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Like John, I tried several times (both Mac and Windows IE) and never got anything funny. How many times do you usually have to refresh before you see the problem? (I think I viewed it 4 times). miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The errors appear to be the result of strings not terminating properly from the PHP output. Then partial HTML code is inserted in cells or at the top of the table. I have stripped everything out and am now just creating a loop to build a table and still get the same errors. I have checked it with IE 5.5, IE 6, NS 4.78 and NS6.2.2 all with the same type of errors. Here is a link to the page that creates the table: http://www.coloradowinware.com/sample/error/sample.php Depending on your connection speed it may take a few seconds, it is generating 650 rows. You may need to refresh a couple of times to see the errors. Some times there is text printed above the table and sometimes there is partial html in table cells and other times there may be colored cells. Here is the source for the page: Thanks for your help. HTML HEAD TITLEPHP Test/TITLE /HEAD body ?php buildtable() ? ?php function buildtable() { //print header row print table border='2' cellspacing='0' bordercolor='#C0C0C0' width='97%' id='AutoNumber2' style='border-collapse: collapse' bgcolor='#FF'; print tr; print td width='4%' align='center' bgcolor='#FFCC00'nbsp;/td; print td width='28%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Name/font/b/td; print td width='13%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Phone/font/b/td; print td width='29%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'E-Mail/font/b/td; print td width='22%' align='center' bgcolor='#FFCC00'bfont size='2' face='Verdana'Department/font/b/td; print td width='4%' bgcolor='#FFCC00'nbsp;/td; print /tr; //end print header row $i=0; $number = 650; while ($i $number) : $name = Fred Flintstone; $email = My Mail; $department = Department; print tr; print td width='4%' align='center' bgcolor='#FF'p align='center' bgcolor='#FF'font size='1' face='Verdana' . $i . /font/td; print td width='28%' bgcolor='#FF'font size='1' face='Verdana'fred/font/td; print td width='13%' bgcolor='#FF'font size='1' face='Verdana'255-3698/font/td; print td width='29%' bgcolor='#FF'a href=mailto:[EMAIL PROTECTED]font size='1' face='Verdana'fred/font/a/td; print td width='22%' bgcolor='#FF'font size='1' face='Verdana'department/font/td; print td width='4%' bgcolor='#FF'nbsp;/td; print /tr; $i++; endwhile; // close table print /table; return; } ? /body /html Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What is the specific nature of the errors in the HTML? Are random characters missing/inserted, or does it look like something that could happen as a result of unexpected program behavior at a higher level? miguel On Thu, 23 May 2002, Tim Greenleaf wrote: The source HTML (PHP Output) is sometimes correct and sometimes incorrect with the exact same script and SQL statement. The table is very basic. I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all
RE: [PHP] Create table with varying results
My testing was on a Win box with apache/php and browser was ie5.5 - I haven't uploaded the test code to any of my lamp boxes to check it there but don't believe it would matter if I did. Here is the source for the page: Before testing your code I did make changes, I'll note them as we go... print table border='2' cellspacing='0' bordercolor='#C0C0C0' width='97%' id='AutoNumber2' style='border-collapse: collapse' bgcolor='#FF'; You may find compressing a lot of this to a style sheet will aid readability. It is also not necessary to put quotes around only numbers (ie. Border=2 is valid but width=97% is needed - for 'correct' html anyway - various browser will figure such things out). print tr; print td width='4%' align='center' [etc] Nothing worth changing in your title row. $i=0; $number = 650; while ($i $number) : $name = Fred Flintstone; $email = My Mail; $department = Department; OK, my preference is to use: while($i $number) { } So that's what I changed the test code to. print tr; print td width='4%' align='center' bgcolor='#FF'p [etc] Nothing in particular wrong with the display code although using a style sheet would probably help for readability. $i++; endwhile; On mine it's a '}' to finish the while loop. I've reloaded it about ten or fifteen times with the exact same result each time. FWIW here's the code that's working here (I stripped out the cell formatting stuff just to make it fit in an email better - but it works here with your formatting in place). !-- -8-CUT HERE-8- table border=2 cellspacing=0 bordercolor=#C0C0C0 width=97% id=AutoNumber2 style=border-collapse: collapse bgcolor=#FF tr td width=4% align=center bgcolor=#FFCC00nbsp;/td td width=28% align=center bgcolor=#FFCC00Name/td td width=13% align=center bgcolor=#FFCC00Phone/td td width=29% align=center bgcolor=#FFCC00E-Mail/td td width=22% align=center bgcolor=#FFCC00Department/td td width=4% bgcolor=#FFCC00nbsp;/td /tr ?PHP $i = 0; $number = 650; while ($i $number) { $name = Fred Flintstone; $email = My Mail; $department = Department; ? tr td width=4% align=center bgcolor=#FF?=$i?/td td width=28% bgcolor=#FF?=$name?/td td width=13% bgcolor=#FF255-3698/td td width=29% bgcolor=#FFa href=mailto:[EMAIL PROTECTED];?=$email?/a/td td width=22% bgcolor=#FF?=$department?/td td width=4% bgcolor=#FFnbsp;/td /tr ?PHP $i++; } ? /table -8-CUT HERE-8- -- CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Create table with varying results
I thought maybe I had some problems with formatting variables in the HTML so I took all the formatting out of the script so it is really basic now and still have the same problem. I also thought maybe there were issues with the data...i.e. with nulls and non-alpha-numeric characters. I cleaned all the data so there is no null data and all characters are alpha-numeric. Still have the same problem. Certainly sounds that way, however, I have built exceedingly complex pages with tables nested, on one occasion to about four or five levels, and the page doesn't fail to render correctly in multiple versions of multiple browsers on multiple machines. In almost every case of odd results it's been a code layout problem that resulted in an html element not having an appropriate closing tag or it's been due to the data itself - with the data keep in mind that an unfortunately placed quote, greater than, less than or some other characters can have an effect on rendering your page in html. Pick a page that doesn't view right then view it's source. Examine the source to see why it's not right - what did it do, what code isn't right? Then compare the place where the final html isn't right with the relevant part of your php source to see why it would happen - how it would get from the php version to the browsed html version. Once you look at that specific area you'll be closer to working out what is going on. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Create table with varying results
I have a search page that creates a dynamic table of results from MS SQL Server. The table created on the web page does not always get created properly for the same recordset. If it was me I'd be doing a view source on the displayed page and comparing what it looks like to what you thought your php page was supposed to generate. In these cases I sometimes find that I haven't taken the data being displayed into account and other times it's because the program flow interrupts things like closing table cells and rows. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create table
Hello, Can anyone please tell me how to create a table in mysql using php code.. -Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Create table
On Wednesday 27 March 2002 16:51, Uma Shankari T. wrote: Hello, Can anyone please tell me how to create a table in mysql using php code.. sigh This is really basic stuff. Please take a look at the numerous tutorials out the on the world wide web. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* When you don't know what to do, walk fast and look worried. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Create table
Here you go: ? // // // EXAMPLE OF CREATING A MYSQL TABLE WITH PHP // // // // // include common routines -- gives the db variables for dbhost, dbuser, dbpassword, db include 'zcommon.php'; // Connecting, selecting database $link = mysql_connect($dbhost, $dbuser, $dbpassword) or die(System level error: Could not connect to database: at routine BLAH0: email $sysadminemail); mysql_select_db($db) or die(System level error: Could not select database: at add routine BLAH1: email $sysadminemail); // create the insert query $query = CREATE TABLE list ( list_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ; //picked up this DIE technique from someone on the list. // Wonderful way to handle bad queries. Recommended. Sorry I can't give credit. $result=mysql_query($query) or die ('H1 align=centerfont color=redBad Database Request/font/H2 in :BR' .__FILE__ .' line '.__LINE__ .'BRbr /bThe query used was:/bBRBR '.$query .'BRbr /bMySQL says/bBRBR '.mysql_error() .'BRBREmail administrator for help at ' . $sysadminemail . ' for help' ); // Closing connection to the db mysql_close($link); ? * * * * * * * * * * * * * * * * * * * * * * * * * * J. Scott Johnson PHP Consulting and Design Work * * * * * * * * * * * * * * * * * * * * * * * * * * Virtual: * * * * * * * * * * * * * * * * * * * * * * * * * * [EMAIL PROTECTED] http://www.fuzzygroup.com/ Yahoo IM: fuzzygroup -Original Message- From: Uma Shankari T. [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 3:51 AM To: PHP Subject: [PHP] Create table Hello, Can anyone please tell me how to create a table in mysql using php code.. -Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php