Wrox Programmer Forums
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases 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 5th, 2006, 09:31 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default SPACING PROBLEM

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:26 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

Hai, you already post this question, anyway see the sample code here, or check your other post.
<pre>
<?php
echo "suren"." "."dran";
?>
</pre>


surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old November 14th, 2006, 07:54 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why not create a html table?


 
Old November 16th, 2006, 10:11 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

helo surendan tnx for your cooperation: ill give you the whole code coz i applied your code but not running

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 "<b>$CATEGORY</b>"; //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"; // display the description and the quantity
    echo "\n$QUANTITY";
    echo "<br>";
  }

}
?>


 
Old December 8th, 2006, 04:47 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

while ($items = mysql_fetch_array($results2)) {
extract($items);
echo "<pre>";
echo $DESCRIPTION." ".$QUANTITY;
echo "</pre>";
echo "<br>";
}

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old December 11th, 2006, 06:37 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you very much surendran...

 the result is like this:


Water Sports

Weekend Pass 20.000

Jacuzzi

Spinning

1 Hour Spinning 4.000

Feet Massage 6.000

i have a question....

how to make the quantity in straight vertical form?

thank you..


 
Old December 19th, 2006, 02:20 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

hi,
Please insert inside table like this

echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
while ($items = mysql_fetch_array($results2)) {
extract($items);
echo "<tr>";
echo "<td>";
echo $DESCRIPTION ;
echo "</td>";
echo "<td>";
echo $QUANTITY ;
echo "</td>";
echo "</tr>";
}
echo "</table>";

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old December 19th, 2006, 07:07 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello surendan thank you,
  its working they both aline but,
how about if it is not inside the table? is their any possible code to make them straight vertical line even it is not inside the table?

  again thank you;

.::JHANNY::.






Similar Threads
Thread Thread Starter Forum Replies Last Post
spacing in between the words ramank Classic ASP Basics 1 November 20th, 2006 07:25 AM
PROBLEM SPACING jhanny007 Beginning PHP 2 November 16th, 2006 09:46 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.