I'm new to mysql but seem to understand it enough to do what simple stuff I need but I can't get even this basic script to echo what is in the one colum, one row table.
I am able to connect now it seems since I don't get any errors anymore in logs or browser.
Im trying to get this working first then I need to access it from another domain and write to it.
I only need a reference # that I can read and then add 1 to it. I tried to do it with a text file with fread and fwrite the way I used to but now I need to be able to write to it from other domains and can't figure it out to save my life.
I was told mysql database would work. Any help would be GREATLY appreciated. I should be able to figure most of it out myself when I get some basic functionality going.
Thanks.
-----------------------------------------------------------
PHP Version 4.3.9
phpMyAdmin 2.6.4-pl3
MySQL 4.1.20 running on localhost:3306 as counterlead2@lo calhost
-------------------------------------------------------------
SCRIPT:
<?
$mysql_server = 'localhost';
$mysql_user = "counterlea d";
$mysql_pass = "fhujeduu";
$mysql_db = "leadsnumfi le";
$ntable = 'ntable';
$column = 'number';
mysql_connect($ mysql_server,$m ysql_user,$mysq l_pass) or die("Unable toconnect1 to database");
mysql_select_db ($mysql_db) or die("Unable toconnect2 to database");
$sql = 'SELECT * FROM `ntable` LIMIT 0, 30 ' or die(mysql_error );
echo "$sql";
?>
I am able to connect now it seems since I don't get any errors anymore in logs or browser.
Im trying to get this working first then I need to access it from another domain and write to it.
I only need a reference # that I can read and then add 1 to it. I tried to do it with a text file with fread and fwrite the way I used to but now I need to be able to write to it from other domains and can't figure it out to save my life.
I was told mysql database would work. Any help would be GREATLY appreciated. I should be able to figure most of it out myself when I get some basic functionality going.
Thanks.
-----------------------------------------------------------
PHP Version 4.3.9
phpMyAdmin 2.6.4-pl3
MySQL 4.1.20 running on localhost:3306 as counterlead2@lo calhost
-------------------------------------------------------------
SCRIPT:
<?
$mysql_server = 'localhost';
$mysql_user = "counterlea d";
$mysql_pass = "fhujeduu";
$mysql_db = "leadsnumfi le";
$ntable = 'ntable';
$column = 'number';
mysql_connect($ mysql_server,$m ysql_user,$mysq l_pass) or die("Unable toconnect1 to database");
mysql_select_db ($mysql_db) or die("Unable toconnect2 to database");
$sql = 'SELECT * FROM `ntable` LIMIT 0, 30 ' or die(mysql_error );
echo "$sql";
?>
Comment