Jump to content

Search the Community

Showing results for tags 'separate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I've always found the task difficult. I use includes and functions wherever I can, but sometimes it seems impossible. Take this code for example: <div> <?php $gotContents = printContents($linkDB, 'home'); foreach($gotContents as $k){ echo "<div class = \"catContents\">"; echo "<div class = \"contentTitle\">".contentTitle($linkDB, $k)[0]."</div>"; echo cutContent($k); echo "</div>"; } ?> </div> Here, there's no way (that I can see) to separate the HTML from the PHP; I can't divide the code into different files since I need parts of it to be encased in DIVs. So, is this type of code acceptable, or is there a better way to handle it? If so, how? Thanks in advance for any replies. EDIT: Also, I'm not interested in using any third-party software/add-on- just raw PHP and HTML please.
  2. I've got the following code below and it works great. It's list all the entrys in the database that meet those specifications and it's sorted by the title of need and the ID. My question is is there a way to put a space between the different titled groups. Right now it looks like this: Title1 Title1 Title1 Title2 Title3 Title3 But I'd like for it to look like this: Title1 Title1 Title1 Title2 Title3 Title3 I'm not sure how to go about it. Thanks for the help! $query = mysql_query("SELECT * FROM needs WHERE status !='hidden' AND status !='denied' AND status !='deleted' AND status !='expired' AND (workerfoldername IS NULL OR workerfoldername='') AND (needsusername='$username' OR workerusername='$username') ORDER BY titleofneed, ID"); echo "<table border='1'><tr><th><center>Title of Need</center></th><th><center> Organization </center></th><th><center>Needs Username</center></th><th><center>Worker Username</center></th><th><center>City, State</center></th></tr>"; while ($rows = mysql_fetch_array($query)) { $id = $rows['ID']; $status = $rows['status']; $firstname = $rows['firstname']; $city = $rows['city']; $state = $rows['state']; $phone = $rows['phone']; $email = $rows['email']; $typeofneed = $rows['typeofneed']; $description = $rows['description']; $workername = $rows['workername']; $workeremail = $rows['workeremail']; $workerphone = $rows['workerphone']; $completiondate = $rows['completiondate']; $needsusername = $rows['needsusername']; $workerusername = $rows['workerusername']; $howmanypeopleneeded = $rows['howmanypeopleneeded']; $howmanypeoplesignedup = $rows['howmanypeoplesignedup']; $titleofneed = $rows['titleofneed']; $theneedsfoldername = $rows['needsfoldername']; $theworkerfoldername = $rows['workerfoldername']; if (($needsusername == $username && $theneedsfoldername == '') || ($workerusername == $username && $theworkerfoldername == '')) { $orgname = $rows['orgname']; $expiredate = $rows['expiredate']; echo " <tr><td>$titleofneed</td><td>$orgname</td><td>$needsusername</td><td>$workerusername</td><td>$city, $state</td><td>view more</td></tr> "; } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.