Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2048 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

SQL Help

Thread title: SQL Help
Closed Thread    
    Thread tools Search this thread Display Modes  
03-10-2007, 12:32 AM
#1
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old  SQL Help

PHP Code:
   $sql "select d.title, d.downloads, d.hits, d.rating, d.userid, c.category from wallpaper d, categories c where d.wallpaperid = $wallpaperid and c.categoryid = d.categoryid";
   
$result mysql_query($sql ,$db);

   if (
$myrow mysql_fetch_array($result)) {
      do {
         
$pagetitle $myrow["title"];
         
$downloads $myrow["downloads"];
         
$hits $myrow["hits"];
         
$wallpaperrating $myrow["rating"];
         
$userid $myrow["userid"];
         
$category $myrow["category"];
      } while (
$myrow mysql_fetch_array($result));

   } 
Code:
Breadcrumbs: <a href="url">title</a> &raquo; <a href="domain.com/cat/<?php printf($categoryid); ?>/"><?php printf($category); ?></a> &raquo; <strong><?php printf($pagetitle); ?></strong><br />
This is how the code turns out:
Code:
Breadcrumbs: <a href="url">title</a> » <a href="domain.com/cat//">cat</a> » pagetitle
See: <a href="domain.com/cat/<?php printf($categoryid); ?>/"> does not render, I'm not sure if it's getting pulled from the database correctly, could someone take a look?

Edit: Just you so know, it's fixed. Thanks anyway.

03-10-2007, 01:34 AM
#2
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

I see you fixed it but I think it wasn't working because you were using printf() with only one parameter. A simple echo could've worked.

03-14-2007, 06:59 PM
#3
mikeroq is offline mikeroq
mikeroq's Avatar
Status: Member
Join date: Feb 2006
Location: Ponca City, OK
Expertise: xHTML/CSS/PHP/Computer Tech
Software: Photoshop, Notepad++, Winamp
 
Posts: 332
iTrader: 5 / 100%
 

mikeroq is an unknown quantity at this point

Send a message via AIM to mikeroq Send a message via MSN to mikeroq Send a message via Yahoo to mikeroq

  Old

I would remove these:
PHP Code:
<?php printf($categoryid); ?>
and replace them with:
PHP Code:
<?=$categoryid?>
Also replace your mysql_fetch_array's with mysql_ferch_assoc's

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed