Trying to setup PHP Template Website

If you need help building your website, this is the place to hang out. If you're an HTML, PHP, Perl or web database geek, check it out. / Si vous avez besoin d'aide pour construire votre site web, c'est le forum à regarder! Si vous êtes un expert en HTML, PHP, Perl ou en base de données, c'est le forum pour vous!
Foo
The SuperStar
Posts: 1566
Joined: Thu Dec 29, 2005 12:56 pm

Re: Trying to setup PHP Template Website

Post by Foo »

some errors in your query

$MainQuery = "SELECT Name FROM TeamProInfo WHERE Number = '$Team' " ;

$PlayerQuery = "SELECT * FROM PlayerInfo WHERE TeamName = '$TeamName' ";

also, for column titles it is preferable to put them like this if they contain spaces

`PlayerInfo`
Image
Image
Image
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

That worked like a charm...Much appreciated! So now I notice the Farm Team name in PlayerInfo has the pro team abbreviation at the end. Any idea how I can combine the "SELECT Name FROM TeamFarmInfo WHERE Number = '$Team'" and "SELECT Abbre FROM TeamProInfo WHERE Number = '$Team'" to create Providence Bruins (BOS) as a string to pull those players?
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

Never mind...I was able to do it using LIKE '%$FarmTeamName%' rather than trying to combine the values from 2 separate columns in 2 separate tables.
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

So now the new issue...When I pull the data back into the site it goes outside of the page border which I have set to 1000px. I have a div id set and it is inside the border but the tables it pulls it go outside of that. Any ideas? I've tried putting width="819px" (I have a menu on the left that takes up 120px and the container where the tables go starts at 121px) everywhere to no avail. The tables start properly but go way too wide.

Basically my question is how can I force the output of the query to fit into a box with a specific height and width?
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

Anyone have any ideas with regards to the table that has the roster going outside the body of the website?
ynohtna
The Addict / Le Drogué
Posts: 770
Joined: Mon Aug 14, 2006 5:15 pm
Location: Vancouver, BC
Contact:

Re: Trying to setup PHP Template Website

Post by ynohtna »

I don't think you can output a whole row and have it formatted... think you will need put the data in an array then have a php loop to print each cell... and value for that cell, or at least that's what I think I see in examples Simon posted on github.

I haven't dug into it too much yet.
BFHL Admin/Commish
http://www.thebfhl.ca/bfhl
Now in Season 15, using BRHL Player v2.1 Ratings modified.
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

Yeah that's what I'm doing. I'm getting all the data back as an array then echoing the data into a table. Problem is the table doesn't seem to be take any html format commands.
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

I think I'm past the table sizing issue. Now I'm trying to pull in team and league leaders as a side bar. Not having much luck so far. Anyone have any pointers for doing so?
opeth771
The Accomplished One / L'Accompli
Posts: 129
Joined: Sat Feb 25, 2012 9:49 am

Re: Trying to setup PHP Template Website

Post by opeth771 »

Bmoney0313 wrote:I think I'm past the table sizing issue. Now I'm trying to pull in team and league leaders as a side bar. Not having much luck so far. Anyone have any pointers for doing so?
You need to use HTML and CSS. Create a <content> and a <aside> tag and then have them both float:left

Warning: make sure both div's combined width is not > 100% or else, this method won't work. Also, if you have a margin, don't forget to add it to the calculation or else, it won't work either.
Bmoney0313
New in Town / Le Ptit Nouveau
Posts: 43
Joined: Tue Jun 19, 2012 1:25 pm

Re: Trying to setup PHP Template Website

Post by Bmoney0313 »

Thanks, it's been a while since I've worked on this since Dreamweaver decided to overwrite my almost complete style.css file. But I appreciated your input.
Post Reply