php and insert query

I have a insert.php which is suppose to show a record on the screen. I
run it and see nothing on the screen. following is the code used

<?php
$mysql_id = mysql_connect(localhost, 'root', 'kali');
mysql_select_db($mysql_id, 'memphisproject');
$result = mysql_query($mysql_id, select * from tblsponsor);
while ($row1 = mysql_fetch_row($result)) {
echo $row1[0];
}
mysql_free_result($result);
/>

This is on a test box to eventually be transferred to a web hosting
company. Another question is when you build a database with phpmyadmin
where is it stored on the test box. what is the connection string to be
used. Thanks in advance

seeker55


--
seeker55
------------------------------------------------------------ ------------
seeker55's Profile: http://techiegroups.com/member.php?userid=181
View this thread: http://www.techiegroups.com/showthread.php?t=114402
seeker55 [ So, 13 August 2006 07:12 ] [ ID #1428769 ]

Re: php and insert query

seeker55 wrote:
> I have a insert.php which is suppose to show a record on the screen. I
> run it and see nothing on the screen. following is the code used
>
> <?php
> $mysql_id = mysql_connect(localhost, 'root', 'kali');
> mysql_select_db($mysql_id, 'memphisproject');
> $result = mysql_query($mysql_id, select * from tblsponsor);
This line isn't correct, do

$result=mysql_query("select * from tblsponsor");

or

$result=mysql_query("select * from tblsponsor",$mysql_id);

(as long as you working against one sql server in your script, you don't need
to use the $mysql_id as the latest connection will always be used if this info
is omitted).

> while ($row1 = mysql_fetch_row($result)) {
> echo $row1[0];
> }
> mysql_free_result($result);
> />
>
> This is on a test box to eventually be transferred to a web hosting
> company. Another question is when you build a database with phpmyadmin
> where is it stored on the test box.

The data goes into the database, where the files with the data is stored
depends on where you sql server is installed and what OS you are running.


//Aho
Shion [ So, 13 August 2006 07:21 ] [ ID #1428770 ]

Re: php and insert query

seeker55 wrote:
> I have a insert.php which is suppose to show a record on the screen. I
> run it and see nothing on the screen. following is the code used
>
> <?php
> $mysql_id = mysql_connect(localhost, 'root', 'kali');
> mysql_select_db($mysql_id, 'memphisproject');
> $result = mysql_query($mysql_id, select * from tblsponsor);
> while ($row1 = mysql_fetch_row($result)) {
> echo $row1[0];
> }
> mysql_free_result($result);
> />
>
> This is on a test box to eventually be transferred to a web hosting
> company. Another question is when you build a database with phpmyadmin
> where is it stored on the test box. what is the connection string to be
> used. Thanks in advance
>
> seeker55
>
>
> --
> seeker55
> ------------------------------------------------------------ ------------
> seeker55's Profile: http://techiegroups.com/member.php?userid=181
> View this thread: http://www.techiegroups.com/showthread.php?t=114402

and now change your password
zac.carey [ Mi, 16 August 2006 15:43 ] [ ID #1432794 ]
PHP » alt.php.sql » php and insert query

Vorheriges Thema: help for opimizing a query
Nächstes Thema: Login with password