MadMax82
11-18-2000, 06:29 PM
Ok gang,
I am a complete novice with PHP and MySQL (trying to expand my knowledge ya know!). I have created a database on an Alabanza account and I have no problem creating tables, variables, etc. And I have put some sample data in the database with no problems. However when I use the PHP example listed in the Alabanza knowledgebase I am getting the following error:
Warning: 0 is not a MySQL result index in /home/websat/websatori-www/test3.php on line 23
I have gone so far as to create a database with the same table name and variables as the example. Here is my PHP code (with login and password deleted):
<?
mysql_connect("localhost", *****, ******);
$result = mysql(mydatabase, "select * from products");
$i = 1;
while($i <= 3) {
echo mysql_result($result,$i,"prodid");*
<p>
echo mysql_result($result,$i,"name");*</p>
<p>
echo mysql_result($result,$i,"price");*</p>
<p>
$i++;}
?></p>
I would greatly appreciate it if any of you experts out there could give me an idea of what I am missing. Is it the PHP code or do I need to specify something in MySQL (I have a key variable). Any help would be greatly appreciated!
I am a complete novice with PHP and MySQL (trying to expand my knowledge ya know!). I have created a database on an Alabanza account and I have no problem creating tables, variables, etc. And I have put some sample data in the database with no problems. However when I use the PHP example listed in the Alabanza knowledgebase I am getting the following error:
Warning: 0 is not a MySQL result index in /home/websat/websatori-www/test3.php on line 23
I have gone so far as to create a database with the same table name and variables as the example. Here is my PHP code (with login and password deleted):
<?
mysql_connect("localhost", *****, ******);
$result = mysql(mydatabase, "select * from products");
$i = 1;
while($i <= 3) {
echo mysql_result($result,$i,"prodid");*
<p>
echo mysql_result($result,$i,"name");*</p>
<p>
echo mysql_result($result,$i,"price");*</p>
<p>
$i++;}
?></p>
I would greatly appreciate it if any of you experts out there could give me an idea of what I am missing. Is it the PHP code or do I need to specify something in MySQL (I have a key variable). Any help would be greatly appreciated!
