You are here: Re: Can anyone help me with this problem please....? « PHP Programming Language « IT news, forums, messages
Re: Can anyone help me with this problem please....?

Posted by Jerry Stuckle on 11/14/36 11:21

toedipper wrote:
> Hello,
>
> The following code grabs the url of a file location on the net from a db
> on my server for a file download.
>
>
> // connection to grab url of the file
> mysql_select_db($database_local, $local);
> $query_dllink = sprintf("SELECT dllink FROM software WHERE swid =
> %s",$colname_dllink);
> $dllink = mysql_query($query_dllink, $local) or die(mysql_error());
> $row_dllink = mysql_fetch_assoc($dllink);
> $totalRows_dllink = mysql_num_rows($dllink);
> ?>
>
> So I've gone and grabbed the location.
>
> I then stick this following bit in between the header sections on my
> html page, note I am trying to kick of the download.
>
> <? echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"6;
> URL=http://\"$dllink\" \">"; ?>
>
> This all work on paper but nothing happens. Basically I want to grab a
> file location url from my db and then start to download that file to the
> user. I am not sure if I am doing this right at all so help would be
> appreciated.
>
> Any ideas?
>
> tia.
>
> td.

TD,

The results of a call to mysql_query is not the data itself - it is a mysql
result set if the query works, or false if the query fails. You get the actual
data, one row at a time, by calling mysql_fetch_array or mysql_fetch_assoc.

In your example, you call mysql_fetch_assoc. So the value $row_dllink['dllink']
(aka $row_dllink[0] contains the results of the first query row (assuming the
query worked - ensure to check for failure!).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация