Page 2 of 2

Re: Trying to setup PHP Template Website

Posted: Tue Sep 08, 2015 8:41 am
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`

Re: Trying to setup PHP Template Website

Posted: Tue Sep 08, 2015 9:23 am
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?

Re: Trying to setup PHP Template Website

Posted: Tue Sep 08, 2015 9:53 am
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.

Re: Trying to setup PHP Template Website

Posted: Tue Sep 08, 2015 5:14 pm
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?

Re: Trying to setup PHP Template Website

Posted: Thu Sep 10, 2015 4:30 pm
by Bmoney0313
Anyone have any ideas with regards to the table that has the roster going outside the body of the website?

Re: Trying to setup PHP Template Website

Posted: Fri Sep 11, 2015 7:40 pm
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.

Re: Trying to setup PHP Template Website

Posted: Sat Sep 12, 2015 8:50 am
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.

Re: Trying to setup PHP Template Website

Posted: Sun Sep 13, 2015 11:11 am
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?

Re: Trying to setup PHP Template Website

Posted: Mon Nov 30, 2015 1:28 pm
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.

Re: Trying to setup PHP Template Website

Posted: Mon Nov 30, 2015 1:31 pm
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.