Jump to content

BLaZuRE

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Everything posted by BLaZuRE

  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).
  16. Well, your error is saying your variable's undefined. You need to check whether it's defined or not before you manipulate it. You can use isset($variable) to determine whether $variable is set ("defined") and not NULL.
  17. If you need help restoring prices then marking them up: price / 0.06 * 1.06 price / 0.06 restores the orig * 0.06 error *1.06 does the 6 percent markup By the way, using order of operations on the above post, you get (price * .12) since multiplication comes first.
  18. You're querying FROM the second table too. Add the ORDER BY as given above. Add a WHERE x.id_1=y.id_2 (x and y are the table names, id_1 and id_2 are the field names)
  19. You'll probably have more luck on the JavaScript thread since you're asking about JavaScript, not PHP. Try doing an individual onclick/onmouseover/onmouseout for the cells instead of the row. If the row is actually doing something, then grab the row by its ID (give it one) and act on the row.
  20. I'm curious, what do you not know how to change and/or what did you try? I don't see a simpler way than directly giving you the code. Is this your code or did you grab it from somewhere else? Sorry if this is harsh, but I don't get why you don't get it.
  21. Look at my post above. Do you need 3 or 4 arguments? Do you have two $id's by mistake or are they supposed to be there? If you're supposed to have 4 arguments, rename of your $id's appropriately (like if you wanted a $student_id and a $teacher_id or something). If you made a mistake in writing your function and wanted 3 arguments, remove an $id. Adjust your code accordingly if you rename an $id. The error is telling you exactly what's wrong again. Use the color in your post to your own advantage. It's there for a reason (and get Notepad ++ or Scite for coding if your editor doesn't do syntax highlighting (colors) and is black and white).
  22. Alt tags are supposed to describe the photo itself. The search engine already knows what is relevant and not on the page. Don't try and force them to take a keyword; you might burn yourself. Search engines do not have access to anything not linked on your site, besides the usuals like robots.txt or favicon.ico. There's no way it would index or even want to index an SQL database. You have to code for it to get onto the photo itself. That means query the database, obtain the row, and echo the output using PHP and put in the alt text dynamically, server-side. In past experience, search engines do a great job if your site is readable (images aren't; tags/text are), standards-compliant, content is concise and describes the company/org/website, and sometimes if reputable sites link to you (I don't think 'yellow pages' and massive link collection websites really count).
  23. Raw, unchecked code: SELECT companies.companyid, companies.companyname, companies.companylogo, companies.companyoccupation, companies.industry, eQuestions.capitalrequested FROM companies, eQuestions WHERE companies.companyid = eQuestions.companyid; No Left Join needed. You want Left Join when you require everything from the left table and also want what's matched on the right.
  24. Give FRAMEWORK an absolute location instead of a relative location. Also, is this the full warning? or a partial with an explanation?
  25. What do you mean it's not displaying data correctly? What's 'correctly' for you? Each row for eQuestions will have a result row with its corresponding company based on its companyid = companies.companyid. Also, any rows from companies not matched will have a result row with empty rows where results from eQuestions would be. What are you trying to do?
×
×
  • 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.