Jump to content

BLaZuRE

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BLaZuRE's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I'm trying to learn to install stuff from source rather than binaries. I installed Apache successfully and moved on to PHP. Whenever I try to try /usr/local/apache2/bin/apachectl stop or start, I get: [sat May 12 15:08:27.269134 2012] [so:warn] [pid 31017:tid 140056791607072] AH01574: module php5_module is already loaded, skipping [sat May 12 15:08:27.269406 2012] [:crit] [pid 31017:tid 140056791607072] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP. AH00013: Pre-configuration failed I've done some reading on 'threadsafe' php. Seems that people recommend non-threadsafe. Also, I'm wondering about how Apache is running a threaded MPM. My apache config.nice looks like: ./configure --enable-so so I would assume it would default to non-threaded MPM. My PHP config looks like: './configure' \ '--prefix=/usr/local/apache2/php' \ '--with-apxs2=/usr/local/apache2/bin/apxs' \ '--with-config-file-path=/usr/local/apache2/php' \ '--with-mysql' \ "$@" I'm also trying to make it with only what I need. At this point in time, I'm fine with non-threaded, though I think threaded would be better in the future. Currently it's localhost only, but after I learn a bit I wish to start using my configs for development.
  2. I'm looking into creating a structure where a paragraph is hidden until the user clicks a line. I know I could do it using the onLoad method for <body>, but I want it to be an event detected using something on the tag (like using onLoad for the tag itself, which doesn't work, or searching by class) for expandability. Also, the paragraph should be visible to users without JavaScript. I like coding efficiently, so I don't grab all the tags and search by class name, in case there are a lot of the same tag. I hope I made myself clear.
  3. You're on the right track. Basically, if level is a, color is 1 if level is b, color is 2, etc.: if (isset($_POST['level'])) { if ($_POST['level']==$content1) $color = 'blue'; elseif ($_POST['level']==$content2) $color = 'red'; elseif ($_POST['level']=='duck') $color = 'black'; elseif ($_POST['level']==$content4) $color='brown'; elseif ($_POST['level']==$content5) $color='#0000FF'; else $color='yellow'; } Then you can do something like: <?php echo "<span style=\"color: $color;\">$_POST[level]</span>"; ?> or whatever you want it to say
  4. This might help you out: http://php.net/manual/en/function.date.php and http://www.php.net/manual/en/function.strtotime.php function getWeekDays($date) { $offset = ''; if( date('l', strtotime($date)) == 'Monday' ) { //If $date is a Monday, blank offset $offset = ''; } elseif( date('l', strtotime($date)) == 'Sunday' ) { //If $date is a Sunday, offset says Tomorrow is Monday $offset = 'Tomorrow'; } else { //If $date is not a Sunday or Monday, offset says Last Monday to get the last Monday $offset = 'Last Monday'; } $monday = date('m/d/Y', strtotime("$date $offset")); //Displays both $date and $offset (i.e. "01/13/2011LastMonday" $tuesday = date('m/d/Y', strtotime("+1 day", $monday)); //$monday must be an integer timestamp return $tuesday; }
  5. Use WHERE `your_field` < 30 Are you saying search as in text box or search as in searching your database with data provided from pre-made forms (drop-downs, checkboxes, etc)?
  6. Are your $_GET and $_POST variables the values you expect? Use print_r() to verify that: <pre><?php print_r($your_array); ?></pre> Is the correct query executing to render page 2? echo your queries and paste them into PHPMyAdmin to test and see whether it errors or runs correctly, as expected. I don't see anything that catches my eye but you've posted a lot of code. Shorten it to your problem areas and don't post what's not relevant.
  7. BLaZuRE

    PRIMARY KEY

    The query will fail since there is a duplicate key. Therefore, the query function will return false.
  8. Does anyone have any experience with mysqldump permissions, even if it's not with --all-databases?
  9. You've got a typo in: Also, Personally, I would use backticks. Also, strings should be surrounded by single quotes when querying a database: "SELECT * FROM logins where `username` = '$username' and `password` = '$password'"
  10. What is your specific question? Albania doesn't appear on your second table so I don't know what you wanted. Subtracting in a query is simple. If you want fieldA - fieldB, you can do SELECT (fieldA-fieldB) FROM tableC
  11. if delivery_date is already there, then why don't you change it to deliverydate and see if that's the mistake? Also, why don't you post the info here. Just don't go overboard and post dozens and dozens of lines that are irrelevant.
  12. SUM() is a function that calculates the sum for the COLUMN. You can do fielda + fieldb to give you a result of fieldc on rowX. You need to select the data you need where a.the_date = b.transfer_date Essentially, something like (untested): SELECT (a.amount + b.amount) FROM a,b WHERE a.the_date = b.transfer_date
  13. What is the other data? Why did you post the lines above? Are those that give you an error (post error), is that what your gut is telling you, or is that really line 37? Is $chun's value the name of the table you're SELECT'ing * (all fields) FROM? What troubleshooting have you done? Have you made sure the values are what you expect them to be (i.e. echo $select; to verify). You might have extra whitespace with your " Toner" parameter.
  14. In certain scenarios, a variable can still be set but empty. For example: $var = ''; $var is set, to '' but contains an empty string, therefore empty. Not always necessary to know since it doesn't always come up, but they're not equivalent.
  15. I'm guessing your delete query acts after a form is submitted. Variable are not transferred across pages (usually), so the $id you stored in a hidden field gets transferred in $_POST[] just like every other field item value. So you probably have to get your id by doing $_POST['id'] (id was the name of the hidden field).
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.