Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
I didn't even notice that, I thought it was just 1 search field.
-
Basic Pagination Tutorial by Crayon Violent
Maq replied to globetrottingmike's topic in PHP Coding Help
I use notepad++ for quick edits and scripts but I like netbeans for bigger projects. -
I have not tested this, but it looks like it should work, try it without the HTML crap maybe I was forgetting to open/close something. $get_id = $_GET['product_id']; $handle = @fopen("Book1.csv", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $pieces = explode(",", $buffer); $productid = $pieces[0]; $producttitle = $pieces[1]; $productprice = $pieces[2]; if($productid == $get_id) { echo $producttitle; echo $productid; echo $productprice; } } }
-
Oh sorry, I guess I was confused as to exactly what you wanted. There may be a better way but this should work. ***not tested*** if(isset($_POST['login_button']) { $player_logged_in = $_POST['login_name_field']; $query = "SELECT team_id FROM players_table WHERE player_name = '$player_logged_in'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) echo "I am logged in and my team id is: " . $row['team_id'] . " "; $team_search_id = $row['team_id']; $query2 = "SELECT player_name FROM players_table WHERE team_id = '$team_search_id"; $result2 = mysql_query($query2) or die(mysql_error()); echo "Here is everyone on my team:"; while($row2 = mysql_fetch_array($result2)) { echo $row2['player_name'] . " "; } }
-
I'm not to sure I 100% agree with this. Who is the audience? Students, faculty, parents? And what are they looking for, information, times, dates, events, etc... I think as long as you provide that information in a easy to find way then it doesn't matter what the site looks like, to an extent. It's not like he's trying to have people sign up or sell products on the site, people are going to go directly to it, get information, and leave.
-
Try putting <?php at the top before you use php code...
-
Can you post the entire code?
-
This what you mean? $query = "SELECT player_name FROM players_table WHERE team_id = '1'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "Player: " . $row['player_name'] . " "; }
-
Huh? Ok.
-
Yes, you can use relative width/height like percentages instead of a hard coded numbers.
-
I guess you don't need a database but this method is going to be slow with a lot of products. $get_id = $_GET['product_id']; $handle = @fopen("Book1.csv", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $pieces = explode(",", $buffer); $productid = $pieces[0]; $producttitle = $pieces[1]; $productprice = $pieces[2]; if($productid == $get_id) { ?> $".$productprice ?> } }
-
What's the problem?
-
For individual records I would recommend putting these into a database and calling it from there with a query. That way you would have a unique identifier for each product and would have the ability to pull individual or groups of products out. Maybe someone else has a better idea.
-
Can you post the part where you pull the data from the database? You would have to loop through the query results and find out if all the buses are running and set a flag if 1 or more aren't.
-
html Lol, usually is, post the code!!!
-
I think the header would look fine if you had something on the right side. For example you could fade into something else to do with your site. Maybe add some rounded corners or something.
-
Then you have a lot of work to do. Sounds like you don't even have a database or anything set up. Sorry, you might want to try to post in the freelance section because this sounds like a lot of work. I, and most people on these forums, are willing to help here and there but for something like this I don't think anyone really is going to do this for free unless they already have a login system set up to give to you. Good luck.
-
$handle = @fopen("Book1.csv", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $pieces = explode(",", $buffer); $productid = $pieces[0]; $producttitle = $pieces[1]; $productprice = $pieces[2]; ?> $".$productprice ?> }
-
Basic Pagination Tutorial by Crayon Violent
Maq replied to globetrottingmike's topic in PHP Coding Help
Bad idea, Dreamweaver writes horrible code. Huh? -
Never said it did but you're right, it wouldn't resolve the Unexpected T_VARIABLE warning. I was just telling him how to properly display the contents of an array. Anyway, your syntax is correct now, I don't know what is causing this. Does the error specify a line number?
-
It always is...
-
If you want to print the contents of an array you should use print_r($result);
-
No, my script is half pseudo code, it probably won't do anything if you just CnP into your page. You have to modify it to fit your specific code, if you try to do it and post what you have then we can help you further.
-
I see.
-
Sure, try it with your specific code and see what happens.