ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
There's not much general purpose design help we can give you other than "learn PHP and SQL." You should have a table for the users (make them sign in) [minimum fields: ID, username] A table for the adventure as a whole [Minimum fields: ID, title, description] A table for every step of the adventure [Minimum fields: ID, description, choiceAText, choiceAStepID, choiceBText, choiceBStepID (the choices should really be their own table, but I'm keeping it simple)] A table that contains a userID, an adventureStepID, and the choice they made at that step. [Minimum fields: UserId, AdventureStepId, timestamp, NextStepChosen] When they make a choice, insert a row into the last table, then load the step that they chose and display it. When you want to show their history, select from the choices they made ordered by the timestamp of the choices. You can JOIN to the steps table to get the text of each choice and then display their adventure in story mode. -Dan
-
How to use the system() argument correctly?
ManiacDan replied to Freedom-n-Democrazy's topic in PHP Coding Help
"Braking out" has no meaning. What do you WANT this to look like? This is "correct" as far as I can see because it looks like your destination folder is actually called "test.com codebase". Is that not your folder name? -
How to use the system() argument correctly?
ManiacDan replied to Freedom-n-Democrazy's topic in PHP Coding Help
You printed it out and copied it into a terminal and it worked? how is that possible without the proper slashes? Double up on your \ characters, make all \ into \\. -
How to use the system() argument correctly?
ManiacDan replied to Freedom-n-Democrazy's topic in PHP Coding Help
I don't see any syntax errors, but your variables may not be what you expect them to be. Print out this string, then copy/paste it into a terminal and read the error. You can also use the additional arguments to system (or exec) to access the returned values and errors. -Dan -
NOT EVEN CLOSE But whatever, if the error goes away you can be happy.
-
Yes, I know that. That's why I told you that three times. Are you having a problem with this sentence? IF THEY ARE NOT SUBMITTED, MAKE THEM A ZERO (0) IN YOUR QUERY.
-
The error from your PHPMyAdmin change comes from the fact that you're trying to make an unsigned varchar, which is an impossible datatype. -Dan
-
Don't change a number to a string on phpmyadmin, fix the bug in your PHP code. If the field isn't submitted, put a zero there. you're done, no more work required.
-
Because those fields are numbers, and if you leave a number blank you end up with an empty field just like the one in the error I've already pointed out. Hello! Look! '' <-- something <-- nothing You can't have nothing between two commas. For your string fields, what you're thinking of as "nothing" is actually the string '' For your numeric fields, "nothing" is actually nothing and that's illegal in SQL Make it something.
-
You can't just have an empty field. Look at your syntax in the error message, see how you have two commas in a row? That's illegal in SQL. You have to explicitly make it NULL or 0.
-
SoftLayer offers cloud servers, but not shared servers. Rackspace offers all kinds of weird things including shared clouds and stuff. -Dan
-
You create your own engines? What do you mean? For a relatively "flat" setup like this you should use MyISAM. You could also serialize this into an array and stick it in memcache or APC so it's constantly in memory. -Dan
-
Then you've been looking at the wrong places. SoftLayer: 3tb included with all servers, $100/mo/tb thereafter Rackspace: 2tb included with all servers, unknown upgrade price Go to either of those sites and click on their live chat options. -Dan
-
Never ever go near a company that promises unlimited anything.
-
Agreed with Adam. That being said, I used to be a developer at SoftLayer. Despite their recent decrease in quality due to their merger with The Planet and their previous questionable activities regarding the wikileaks fiasco, they're still the best on the market for dedicated unmanaged servers. -Dan
-
Unfortunately step 1 is "learn PHP." There's plenty of new user resources out there, but your question is basically "make an entire functional application for me, quickly!" We don't do entire applications and we don't do things "urgently." You can pay someone, or you can push your completion date out by a couple months until you learn more PHP/MySQL/HTML/JavaScript/CSS. All of those items are separate languages that combine to form a real website. -Dan
-
If you use MySQL with query caching turned on, you'll store the results of this query in memory and the access time will be very fast. -Dan
-
Damn, beaten to it. ^ is a logical XOR pow() is the function for doing exponents. -Dan
-
And...have you used nl2br anywhere? I don't see it.
-
You can use regular expressions to strip out stopwords by making use of the \b character class: php > $a = "Sandy and the band played at Dave and Buster's"; php > echo str_replace('and', '', $a); Sy the b played at Dave Buster's php > echo preg_replace('/\band\b/i', '', $a); Sandy the band played at Dave Buster's php > -Dan
-
trim()'s second argument is a LIST of characters to remove, not a STRING to remove. You can use substr or simply str_replace: $a = str_replace("_league". '', $a); -Dan
-
Well...what does $row['picture_image'] contain? View the HTML source and see what that image tag looks like. Maybe you just need it to say: src="{$row['picture_image']}.jpg" But we need more info than that. -Dan
-
Change your webserver to run on that specific port. Sometimes you could have two entire instances of a webserver running, one for 80 and one for the admin port, though usually it's just a vhost. -Dan
-
Converting a value (price) within a mysql query. Is this possble?
ManiacDan replied to simboski19's topic in MySQL Help
If you store the conversion rate in a table along with the currency, then yes. What does your table look like? -
foreach only analyses array at the start?
ManiacDan replied to freelance84's topic in PHP Coding Help
Told you ;-) Foreach is appropriate if you don't know the keys in advance, though you could still do: $keys = array_keys($aHugeArray); for ( $p = 0; $p < count($keys); $p++ ) { $theVal = $ahugeArray[$keys[$p]]; } As for your actual problem, if the example arrays aren't too complex you might be able to solve this entirely using array_merge and array_unique. Maybe. -Dan