Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2006, 11:34 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default PROBLEM SPACING

Helo...any body concern about my problem

   i want the code or any body can teach me how space data?
heres the code: i want to make a big space between description and quantity besides using "\n" what else are the posible code for it?

  thank you....

CODE:

while ($items = mysql_fetch_array($results2)) {
    extract($items);

    echo "\n$DESCRIPTION $QUANTITY\n"; // display the description and the quantity
    echo "<br>\n";
  }
}


 
Old November 9th, 2006, 12:07 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

<?php
while ($items = mysql_fetch_array($results2)) {
    extract($items);
?>
<pre>
<?php
    echo "\n$DESCRIPTION." ".$QUANTITY\n"; // display the description and the quantity
    echo "<br>\n";
?>
</pre>
<?php
}
}
?>
surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old November 16th, 2006, 09:46 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I THINK I MISS THE WHOLE CODE TO MAKE MY PROBLEM SOLVE...BY THE TNX FOR YOUR COOPERATION....ANYWAY HERE'S THE WHOLE CODE COZ IT SEEMS THAT THE CODE YOU'VE GIVEN TO ME I COUDN'T HANDLE TO THE RIGHT PATH TO MAKE IT CORRECT

THE CODE:

<?php
//connect to MySQL
$connect = mysql_connect("localhost", "root", "") or die ("Hey loser, check your server connection.");
//make sure we’re using the right database
mysql_select_db ("contents");
$querycats="SELECT CATEGORY,
ID_CATEGORY
FROM categories"; // Query to select all the categories to search all the items by using ID_CATEGORY variable.
$results=mysql_query($querycats)or die(mysql_error());
while ($rows = mysql_fetch_array($results)) {
  echo "<br>\n";
  extract($rows);
  $searchcat = $ID_CATEGORY; //declaring variable for to get every corresponds value
  echo "<li>$CATEGORY</li>"; //display the category
   echo "<br>\n";
   }

  $queryitems="SELECT
  DESCRIPTION,
  QUANTITY
  FROM items
  WHERE ID_CATEGORY = '$searchcat'"; // Query to select all items....
                                     //getting the value of every ID_CATEGORY it corresponds the specifi items
                                     // this query implies to display items
  $results2=mysql_query($queryitems)or die(mysql_error());
  while ($items = mysql_fetch_array($results2)) {
    extract($items);

    echo "\n$DESCRIPTION\n \n$QUANTITY"; // display the description and the quantity//// HOW TO MAKE AN SPACE BETWEEN DESCRIPTION AND QUANTITY
    echo "";
    echo "<br>";
  }
}
?>

THANKS






Similar Threads
Thread Thread Starter Forum Replies Last Post
SPACING PROBLEM jhanny007 PHP Databases 7 December 19th, 2006 07:07 AM
spacing in between the words ramank Classic ASP Basics 1 November 20th, 2006 07:25 AM
Line spacing Stevie Dreamweaver (all versions) 3 May 16th, 2005 11:58 AM
simple spacing problem badgolfer XSLT 1 January 28th, 2005 12:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.