View Full Version : Mysql table to adjust page width
My 'Courses' table is too long.
Please check the following link,
http://www.hostovsr.com/test123/courses_view.php
I need to create a table to fit to page width and as the following table,
http://www.tendernews.com/nsearch/psrslt.asp?pttype=10&k1=5245
Can you please help me what is the script to add?
SusanH
07-26-2007, 11:02 AM
If you want to display vertical see this (http://www.websitedatabases.com/database-forum/showpost.php?p=103&postcount=4) thread.
It gives the following error,
************************************************** ****
Search Results
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/host790/public_html/test123/courses.php on line 14
Number matches found:
************************************************** *****
I am not expert in php and mysql,
Please details me to bring the table in vertical.
twenty1
07-27-2007, 05:00 PM
What's 'IT'
How do we know what your line 14 looks like. Why not post the code you are using. :confused:
My 'Courses' table is too long.
Please check the following link,
http://www.hostovsr.com/test123/courses_view.php
I need to create a table to fit to page width and as the following table,
http://www.tendernews.com/nsearch/psrslt.asp?pttype=10&k1=5245
Can you please help me what is the script to add?
twenty1
07-28-2007, 11:10 AM
You would normaly only need to show the important fields in the table view. You can hide fields within the table view in phpmagic.
The error message is telling you to look in line 14. Can you post what line 14 looks like in your courses.php .
It is Ok. I can hide some details in php magic. When I click each row and it should be open in different window with complete details in a Vertical table format. What should I do? Is there any tips?
************************************************** *****
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/host790/public_html/test123/results.php on line 14
Number matches found:
Error message script is as follows
************************************************** *****
<html>
<head>
<title>Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<h1>Search Results</h1>
<?php
$database="host790_product";
mysql_connect ("localhost", "host790_product", "1234");
@mysql_select_db($database) or die( "Unable to select database");
$query = "select * from tablename";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
echo "<p>Number matches found: ".$num_results."</p>";
echo "<hr>";
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
echo "<p><strong># ";
echo stripslashes($row["contact_id"]);
echo "<p><strong>Name: ";
echo stripslashes($row["first_name"]);
echo "<p><strong>Category: ";
echo stripslashes($row["lastname"]);
echo "<p><strong>Comment: ";
echo stripslashes($row["comments"]);
echo "<hr>";
echo "</p>";
}
?>
</body>
</html>
************************************************** *****
twenty1
07-28-2007, 02:58 PM
Is this your tablename?
"select * from tablename
Did you edit the lines to match your db stucture? The script you posted does not reflect the fields in your link (http://www.hostovsr.com/test123/courses_view.php) above either? :confused:
My Table name is "Courses"
and 'field' details are as follows,
Course ID
Course
Course Description
Instructor
Class
Start Date
End Date
Start Time
End Time
Sat
Sun
Mon
Tue
Wed
Thu
Fees
Sandman
08-06-2007, 07:48 PM
If you want to control table width:
open the datalist.php file in notepad or wordpad and find this exact line.
$this->HTML .= "<table cellspacing=1 cellpadding=0 border=0><tr>\n";
* Make your HTML changes:
$this->HTML .= "<table cellspacing=1 cellpadding=0 border=0 align=center width=730><tr>\n";
Hope this helps :D
vBulletin® v3.7.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.