Field type
Moderator: General Moderators
-
Arsench2000
- Forum Commoner
- Posts: 38
- Joined: Sat Sep 15, 2007 8:18 pm
Field type
Hi Im a new in phpmyadmin and need a advice.
Im using field for a web address ,that user can type there any web sait and when showing that records on the web can be a like links that can click and go to the web selected.For example.
Category email url description
any any http://www.anysait.com some text
when shows this records on the web can be clickable the url.
here are the page http://khaarsen.ueuo.com/list.php
thanks
Im using field for a web address ,that user can type there any web sait and when showing that records on the web can be a like links that can click and go to the web selected.For example.
Category email url description
any any http://www.anysait.com some text
when shows this records on the web can be clickable the url.
here are the page http://khaarsen.ueuo.com/list.php
thanks
When you display it on the page just put it in link tags.
Code: Select all
echo '<a href="' . $url . '">' . $url . '</a>';Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
-
Arsench2000
- Forum Commoner
- Posts: 38
- Joined: Sat Sep 15, 2007 8:18 pm
Field
feyd | Please use [/quote]
Hi thank you for your help I dont know where to put it here is my code for select (add is a web sait field)
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="scottayy"]When you display it on the page just put it in link tags.Code: Select all
echo '<a href="' . $url . '">' . $url . '</a>';Hi thank you for your help I dont know where to put it here is my code for select (add is a web sait field)
Code: Select all
$sql = 'SELECT * FROM `links` ORDER BY id DESC';
$result=mysql_query($sql);
?>
</div>
<TABLE BORDER=1 align="center" CELLPADDING=0 CELLSPACING=0>
<TR><TD><div align="center"><span class="style3"> Id</span></div></TD>
<TD><div align="center"><span class="style3"> Category</span></div></TD>
<TD><div align="center"><span class="style3"> E-mail </span></div></TD>
<TD><div align="center"><span class="style3"> URL </span></div></TD>
<TD><div align="center"><span class="style3"> Description </span></div></TD>
</TR>
<?
while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s</td><td> %s</td><td> %s</td><td> %s</td><td> %s</td></tr>", $row["id"],$row["cat"],$row["email"],$row["add"],$row["desc"]);
}
mysql_free_result($result);
mysql_close();
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Maybe this post should belong in the PHP Code forum instead. Anyway, I think this would work:
/josa
Code: Select all
while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s</td><td> %s</td><td> %s</td><td> <a href=\"%s\">%s</a></td><td> %s</td></tr>", $row["id"],$row["cat"],$row["email"],$row["add"],$row["add"],$row["desc"]);
}-
Arsench2000
- Forum Commoner
- Posts: 38
- Joined: Sat Sep 15, 2007 8:18 pm
Thanksss
josa wrote:Maybe this post should belong in the PHP Code forum instead. Anyway, I think this would work:
/josaCode: Select all
while($row = mysql_fetch_array($result)) { printf("<tr><td> %s</td><td> %s</td><td> %s</td><td> <a href="%s">%s</a></td><td> %s</td></tr>", $row["id"],$row["cat"],$row["email"],$row["add"],$row["add"],$row["desc"]); }
Yes friend now it workes thank you very much very much ,please if you can help me in one thing else.
how can I show only 5 records in the page?
thank you again very much
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: Thanksss
Make use of MySQL's LIMIT. i.e. "... ORDER BY `id` DESC LIMIT 5;"Arsench2000 wrote:how can I show only 5 records in the page?
-
Arsench2000
- Forum Commoner
- Posts: 38
- Joined: Sat Sep 15, 2007 8:18 pm
Re: Thanksss
superdezign wrote:Make use of MySQL's LIMIT. i.e. "... ORDER BY `id` DESC LIMIT 5;"Arsench2000 wrote:how can I show only 5 records in the page?
Hi thanks for your message,I need show o5 records on the page but with link to the next records exampl
1
2
3
4
5
then click on the link and show the next 5 records
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
-
Arsench2000
- Forum Commoner
- Posts: 38
- Joined: Sat Sep 15, 2007 8:18 pm
Limit
Thanks again but I think I cant do it because Im new in php and didnt have many experience Im a begginer:)will try to find in other places anyway thanks againsuperdezign wrote:The format of the LIMIT clause is "LIMIT whereToStart, howManyToRetrieve" i.e. LIMIT 0,5.
MySQL's LIMIT is very useful for pagination. On the first page, you'd have LIMIT 0,5 and on the second you'd have LIMIT 5,5 and on the third LIMIT 10,5 etc.
You should be able to figure it out from there.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm