[PHP] Re: Help with MySQL
James Colannino wrote: Hey everyone. I've been reading the list for a long time, but have only really posted to the mailing list a few times. I just had a quick question about MySQL. I'm not sure if this is exactly relevant to PHP, but it is for a PHP application I'm writing, so hopefully that makes this question ok :) Basically, I was wondering if there are any queries in MySQL that I can use to determine the data types used to construct a pre-existing table. The reason I ask is that I went back to look at the data in a table I've been using for a while and realized that I forgot to document what the data types were (DOH!) I'm sure there's something, but I wasn't quite sure what to google for, so I wasn't really able to turn up anything. Thanks! James DESCRIBE tablename -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: help with mysql
Hi, Are you sure that you already enable mysql function on your web server ? Krit Kanrat Tom Flood [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I am just beginning my learning of php and its uses with mysql. I wrote a small program to add information into a mysql database. However my script returns the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/ephi/mysql.php on line 16 what is the problem here? How can I fix it? I truly appreciate any help given. Tom Flood [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: help with mysql
Thank you both, here is the entire code : 1html 2head 3titleUntitled Document/title 4meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 5/head 6 7body 8?php 9 $name = $_GET[name]; 10 $address = $_GET[address]; 11$city = $_GET[city]; 12print Name is $namebr\n; 13print Address is $addressbr\n; 14print City is $citybr\n; 15 16mysql_connect(tflood, thomas91); 17 18$result = mysql_query( 19 insert into ephi.info 20 (name, address, city) values 21 ('$name', '$address', '$city') 22); 23if ($result) { 24 print EOT 25 26 h1 Thank you. /h1 27 Your signup is highly appreciated. To show our appreciation, we will send you something that you, in turn, will appreciate. p 28 Remember our motto: Once a Sinfonian, Always a Sinfonian, Long Live Sinfonia! 29EOT; 30 } 31 else { 32 print Something went wrong dunbass; 33 } 34 mysql_close(); 35? 36/body/html As far as mysql working on the machine, it is. I am able to use the mysql command to loginto the server and query my databases. And I have the MySQL Command Center installed and am able to see the databases on my computer just fine. Thank you for your help. Tom Krit Kanrat [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Are you sure that you already enable mysql function on your web server ? Krit Kanrat Tom Flood [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I am just beginning my learning of php and its uses with mysql. I wrote a small program to add information into a mysql database. However my script returns the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/ephi/mysql.php on line 16 what is the problem here? How can I fix it? I truly appreciate any help given. Tom Flood [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: help with mysql
line 16: mysql_connect(tflood, thomas91); I think you mean: mysql_connect(localhost, tflood, thomas91); otherwise mysql_connect takes tflood as Server and thomas91 as Username (if so, its better to replace passwords with * before posting) - http://ch.php.net/mysql_connect after connecting you need to choose a database, e.g. line 17: mysql_select_db(databasename); also make sure that the mysql-extension is installed and loaded. to check this, create a textfile phpinfo.php with this content: ? phpinfo(); ? check the output for information about mysql g. tinu Tue, 27 Jan 2004 08:51:52 -0500 Tom Flood [EMAIL PROTECTED]: Thank you both, here is the entire code : 1html 2head 3titleUntitled Document/title 4meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 5/head 6 7body 8?php 9 $name = $_GET[name]; 10 $address = $_GET[address]; 11$city = $_GET[city]; 12print Name is $namebr\n; 13print Address is $addressbr\n; 14print City is $citybr\n; 15 16mysql_connect(tflood, thomas91); 17 18$result = mysql_query( 19 insert into ephi.info 20 (name, address, city) values 21 ('$name', '$address', '$city') 22); 23if ($result) { 24 print EOT 25 26 h1 Thank you. /h1 27 Your signup is highly appreciated. To show our appreciation, we will send you something that you, in turn, will appreciate. p 28 Remember our motto: Once a Sinfonian, Always a Sinfonian, Long Live Sinfonia! 29EOT; 30 } 31 else { 32 print Something went wrong dunbass; 33 } 34 mysql_close(); 35? 36/body/html As far as mysql working on the machine, it is. I am able to use the mysql command to loginto the server and query my databases. And I have the MySQL Command Center installed and am able to see the databases on my computer just fine. Thank you for your help. Tom Krit Kanrat [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Are you sure that you already enable mysql function on your web server ? Krit Kanrat Tom Flood [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I am just beginning my learning of php and its uses with mysql. I wrote a small program to add information into a mysql database. However my script returns the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/ephi/mysql.php on line 16 what is the problem here? How can I fix it? I truly appreciate any help given. Tom Flood [EMAIL PROTECTED] -- 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
Re: [PHP] Re: help with mysql
Martin, Thank you for the insight when I ran the php file you suggested, nothing appeared to be related to mysql. I installed both the php and mysql packages onto my Linux box through a rpm installer. Where can I obtain mysql support for php? Tom Martin Luethi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] line 16: mysql_connect(tflood, thomas91); I think you mean: mysql_connect(localhost, tflood, thomas91); otherwise mysql_connect takes tflood as Server and thomas91 as Username (if so, its better to replace passwords with * before posting) - http://ch.php.net/mysql_connect after connecting you need to choose a database, e.g. line 17: mysql_select_db(databasename); also make sure that the mysql-extension is installed and loaded. to check this, create a textfile phpinfo.php with this content: ? phpinfo(); ? check the output for information about mysql g. tinu Tue, 27 Jan 2004 08:51:52 -0500 Tom Flood [EMAIL PROTECTED]: Thank you both, here is the entire code : 1html 2head 3titleUntitled Document/title 4meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 5/head 6 7body 8?php 9 $name = $_GET[name]; 10 $address = $_GET[address]; 11$city = $_GET[city]; 12print Name is $namebr\n; 13print Address is $addressbr\n; 14print City is $citybr\n; 15 16mysql_connect(tflood, thomas91); 17 18$result = mysql_query( 19 insert into ephi.info 20 (name, address, city) values 21 ('$name', '$address', '$city') 22); 23if ($result) { 24 print EOT 25 26 h1 Thank you. /h1 27 Your signup is highly appreciated. To show our appreciation, we will send you something that you, in turn, will appreciate. p 28 Remember our motto: Once a Sinfonian, Always a Sinfonian, Long Live Sinfonia! 29EOT; 30 } 31 else { 32 print Something went wrong dunbass; 33 } 34 mysql_close(); 35? 36/body/html As far as mysql working on the machine, it is. I am able to use the mysql command to loginto the server and query my databases. And I have the MySQL Command Center installed and am able to see the databases on my computer just fine. Thank you for your help. Tom Krit Kanrat [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Are you sure that you already enable mysql function on your web server ? Krit Kanrat Tom Flood [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I am just beginning my learning of php and its uses with mysql. I wrote a small program to add information into a mysql database. However my script returns the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/ephi/mysql.php on line 16 what is the problem here? How can I fix it? I truly appreciate any help given. Tom Flood [EMAIL PROTECTED] -- 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
Re: [PHP] Re: help with mysql
My honest advice, dont use rpm's, you need to compile php via source if you want to do anything out of the ordinary like adding extensions, yes adding mysql is out of the ordinary for a standard rpm lol. Thats just my experience anyway. so ./configure --with-mysql=/usr/local/mysql or whereever you put it Martin, Thank you for the insight when I ran the php file you suggested, nothing appeared to be related to mysql. I installed both the php and mysql packages onto my Linux box through a rpm installer. Where can I obtain mysql support for php? Tom Martin Luethi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] line 16: mysql_connect(tflood, thomas91); I think you mean: mysql_connect(localhost, tflood, thomas91); otherwise mysql_connect takes tflood as Server and thomas91 as Username (if so, its better to replace passwords with * before posting) - http://ch.php.net/mysql_connect after connecting you need to choose a database, e.g. line 17: mysql_select_db(databasename); also make sure that the mysql-extension is installed and loaded. to check this, create a textfile phpinfo.php with this content: ? phpinfo(); ? check the output for information about mysql g. tinu Tue, 27 Jan 2004 08:51:52 -0500 Tom Flood [EMAIL PROTECTED]: Thank you both, here is the entire code : 1html 2head 3titleUntitled Document/title 4meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 5/head 6 7body 8?php 9 $name = $_GET[name]; 10 $address = $_GET[address]; 11$city = $_GET[city]; 12print Name is $namebr\n; 13print Address is $addressbr\n; 14print City is $citybr\n; 15 16mysql_connect(tflood, thomas91); 17 18$result = mysql_query( 19 insert into ephi.info 20 (name, address, city) values 21 ('$name', '$address', '$city') 22); 23if ($result) { 24 print EOT 25 26 h1 Thank you. /h1 27 Your signup is highly appreciated. To show our appreciation, we will send you something that you, in turn, will appreciate. p 28 Remember our motto: Once a Sinfonian, Always a Sinfonian, Long Live Sinfonia! 29EOT; 30 } 31 else { 32 print Something went wrong dunbass; 33 } 34 mysql_close(); 35? 36/body/html As far as mysql working on the machine, it is. I am able to use the mysql command to loginto the server and query my databases. And I have the MySQL Command Center installed and am able to see the databases on my computer just fine. Thank you for your help. Tom Krit Kanrat [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Are you sure that you already enable mysql function on your web server ? Krit Kanrat Tom Flood [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I am just beginning my learning of php and its uses with mysql. I wrote a small program to add information into a mysql database. However my script returns the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/ephi/mysql.php on line 16 what is the problem here? How can I fix it? I truly appreciate any help given. Tom Flood [EMAIL PROTECTED] -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: help with mysql
On Tue, 27 Jan 2004 18:01:40 -0500 Tom Flood [EMAIL PROTECTED] wrote: Martin, Thank you for the insight when I ran the php file you suggested, nothing appeared to be related to mysql. I installed both the php and mysql packages onto my Linux box through a rpm installer. Where can I obtain mysql support for php? Check if you have php-mysql-x.x.x-x.x.rpm installed... -- - E - __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help php MySql link
$db = (localhost,databasename,databasepassword); mysql_select_db(your name?,$db); $result = mysql_query(select column1, column2 from domain, $db); while ($myrow=mysql_fetch_array($result)) echo $myrow[column1]. - .$myrow[column2].br; -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com Rodrigo [EMAIL PROTECTED] wrote in message 000401c1f2cf$28b83f00$d86bbbac@rodirgo">news:000401c1f2cf$28b83f00$d86bbbac@rodirgo... Hi guys, what I need is how to make the link between the php and the Database. Is this the code for it? ro something like that? Help me guys... If you could tell me what each command line do I'd appreciate it, cause I got almost all from a friend, but is incomplete. The code follows this message. $db = (localhost,databasename,databasepassword); mysql_select_db(your name?,$db); $result = mysql_query(select column1, column2 from domain, $db); echo column 1 - column 2; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help required MySql + PHP
Hi Karthik, Most probably the PHP module that you are using with Apache is not compiled with Mysql support. Can you post the information about php installation that you have? Put this in a file called say phpinfo.php: ?php phpinfo(); ? When you view this page in your browser, you will see lot of useful information. It will also show the configure options with which PHP was compiled. In my case, it looks like this Configure Command './configure' '--with-mysql' '--with-pgsql' '--with-apxs' '--with-gd=/usr/local' '--with-png-dir=/usr/local' '--with-zlib-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-freetype-dir=/usr/local' '--enable-trans-sid' '--enable-exif' '--with-xml' '--enable-wddx' '--with-curl=/usr/local' '--with-pdflib=/usr/local' '--with-t1lib=/usr/local' '--enable-ftp' Check if you have --with-mysql in the configure options. Please let us know if you have further problems... Regards, Kundan On 12/6/01 2:08 PM, Karthikeyan [EMAIL PROTECTED] wrote: Dear Members, I installed RedHat 7.1, Apache, PHP4 and MySQL in a Intel Pentium processor system. Everything works fine (i.e. MySQL, PHP, etc). But when I want to connect MySQL through PHP. It is giving an error 'call to unknown function mysql_connect in line in __' . Can any one provide a solution. Thanks in advance yours Karthikeyan - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Help required MySql + PHP
On Thursday 06 December 2001 01:08, Karthikeyan wrote: Dear Members, I installed RedHat 7.1, Apache, PHP4 and MySQL in a Intel Pentium processor system. Everything works fine (i.e. MySQL, PHP, etc). But when I want to connect Is phpinfo() working ? Test on mysql support. Check on the file extensions. If you are using .html or .htm, probably you cant unless you make changes in the /etc/httpd/conf/httpd.conf file. (use .phtml or .php instead) CK Raju -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: help with Mysql Query...
Don't use subselect in MySQL, MYSQL have not completed it now , Use join to instead it. Christian Dechery [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm having trouble puting up a query in Mysql because of his lack of SQL syntax. I have a table A and a table B... I want all occurences from A there are not in B... in ANSI SQL... it's nothing more than: select a.id, a.name from table_a a, table_b b where a.id NOT IN (select id from table_b) and that's it... but in Mysql, since there are no sub-selects, I'm burning my brains out and not getting it... I don't wanna create a temp table like the manual suggests... this is way NOT efficient... I'd rather do it in PHP code than having a query that creates a temporary table, then drop it... _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]