php and insert query

php and insert query

am 13.08.2006 07:12:07 von seeker55

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

$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

Re: php and insert query

am 13.08.2006 07:21:10 von Shion

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
>
> > $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

Re: php and insert query

am 16.08.2006 15:43:02 von zac.carey

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
>
> > $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