Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
I thought that was part of is if statement to see if the submit button was pressed... the code he didn't provide. OP, can you provide all relative code?
-
There are a lot of threads already started for the, "What do you think about Zend?", but here's one that specifically comes to mind, and should give you some good insight, http://www.phpfreaks.com/forums/index.php/topic,239122.msg1114857.html#msg1114857.
-
If you post the code that creates the instance of this class, the methods invoked, and echo what you're passing to it then we may be able to help you.
-
[SOLVED] Setting array to one variable to display later
Maq replied to ratgurrl's topic in PHP Coding Help
Yeah I see what you're saying, I only do that if kids are want answers to homework, and this doesn't look like HW. She was so close anyway... -
[SOLVED] Setting array to one variable to display later
Maq replied to ratgurrl's topic in PHP Coding Help
You're welcome Although, you may want to use KingPhilip's solution because it will eliminate the last comma with the least amount of code. -
Ok... Use the logic I gave you before along with this: $sql="UPDATE Jason SET count = count + 1"; mysql_query($sql) or die(mysql_error());
-
[SOLVED] Setting array to one variable to display later
Maq replied to ratgurrl's topic in PHP Coding Help
if(isset($_POST['pricingSubmit'])) { foreach($_POST['propExterior'] as $key => $value) { $propExterior .= $value . ", "; } echo $propExterior; } ?> -
You're right, you can't use ++ with POST arrays, but you can just do plain old + 1. $count = $_POST['count'] + 1; mysql_select_db("jaybirdf_contestvote", $con); $sql="INSERT INTO Jason (email,count) VALUES ('$_POST[email]','$count')";
-
* Not tested * This is a form that submits to itself and inserts your selected value into the fake table. Let me know if you have any questions about the code //include database connection here if(isset($_POST['submit'])) { $name = mysql_real_escape_string($_POST['menu']); $sql = "INSERT INTO example(name) VALUES('$name') "; $result = mysql_query($sql) or die(mysql_error()); if($result) { echo "successful! you added $name into the database"; } else { echo "failure..."; } } ?> </pre> <form action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="POST"> you me him her <
-
Perl is a good one Google, "loosely typed languages", and try some out, I don't know what you mean by:
-
I don't think you would have much control over IRC and I'm not sure how you would embed it into your site. I did find a pretty cool PHP chat that you could customize and implement into your user namespace, phpFreeChat.
-
Have you read this sticky yet, HEADERS ERROR?
-
how do i put a var in a simple java cancel button ?
Maq replied to jamesxg1's topic in PHP Coding Help
Forgot a single quote right before the quote before "class". -
Your link is broken...
-
How to make an inter-linking sequence of pages run from the same URL?
Maq replied to steve_683's topic in PHP Coding Help
You need to either use an i-frame or AJAX. Iframe is more suitable for a novice. A good solution, when implementing the i-frame approach, is to have each link look like this: iframe_link.php?page=1 iframe_link.php?page=2 iframe_link.php?page=3 //etc... Then your iframe code would look like: $page = $_GET['page']; switch ($page) { case 1: code to be executed for 1 break; case 2: code to be executed for 2; break; case 3: code to be executed for 3; break; default: if not 1, 2, or 3 do something else } You're going to have to look up exact syntax but I'm sure you get the idea. You should try it out and come back with specific questions. Again, this is just my opinion on a good solution for a novice, there are other ways if you don't like this approach. -
If you describe exactly what you're trying to accomplish, we can give you a better solution.
-
What do you mean $get from a mysql table? You can store file names/paths in the DB and call the scripts whenever you want. I'm not exactly sure what you mean.
-
Oh lol, didn't know it was in a loop Yes, I use single quotes for every associative array.
-
how to use an instance of a class inside another classs
Maq replied to lordzardeck's topic in PHP Coding Help
Should just be: $catalog = parent::search_results(); -
Debugging tips, echo $sql to make sure you're passing in the correct string for your query, if the mysql_query cannot execute it will kill the script and output a descriptive error message. Change this: $result2 = mysql_query("SELECT * FROM smith_prog_item WHERE item = $partnumber LIMIT 1"); to this: $sql = "SELECT * FROM smith_prog_item WHERE item = '$partnumber' LIMIT 1"; echo $sql; $result2 = mysql_query($sql) or die(mysql_error()); while ($row2 = mysql_fetch_assoc($result2)) { Also use single quotes in your arrays: $row2["type"] to this: $row2["type"]
-
Yes you can store images as a blob, the only differences are the maximum size - Read more here. What I usually do is store the images in a directory and just store the path to the images wherever necessary in the database. So that you just have to store the images once, saving a lot of space.
-
how to use an instance of a class inside another classs
Maq replied to lordzardeck's topic in PHP Coding Help
class catalog extends datahandler implements IPlugin extends datahandler{ Example straight from the manual - extends. error_reporting(E_ALL); class test { var $var; function test() { $this->var = 3; } } class testing extends test { function testing() { parent::test(); } function My_test() { return $this->var; } } $p = new testing(); echo $p->My_test(); // Returns 3 -
I guess, because you are assigning $community_id a new value 4 times. I think it's small enough that you won't be able to tell. There's also fewer characters in the whole algorithm, other than that I don't think it makes any difference. You can test it by outputting start and stop times in your script.
-
Do you have a database set up to handle this? Or better yet, have you tried anything? There are many threads oh phpfreaks related to this and many tutorials online. I'm sure you can find something, come back with a specific question(s) and we can help you easier.
-
I get the attachment picture in the top middle part of the topic as well. FF3 on Ubuntu 8.10