Jump to content

adriscoll

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

adriscoll's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello. I have an Apache handler but would prefer to use a wget command to pull a .php file that is scripted to query a database. The php runs correctly but my crontab line of code keeps getting rejected. * * * * * /usr/bin/wget http://www.website.com I have tried it using "" quotes around the url. I have also tried it using -q in between the wget and http lines. Whenever there is a space following the /usr/bin/wget section, I get an error saying that it can't be found. I will contact the hosting provider, but wanted to check here first.
  2. PFM, The WHERE statement should have been removed in my code before I posted this. I have a small database and was setting it up to scroll through all entries. I know that is not the best method, but, once I could get that to work, I was then going to do it based on entries made on the current day and run it at 11:59pm.
  3. PFM*, thank you again. I guess there is no need to send a PM over to you now about this one. Very easy fix, so thank you again. I did have a question about the data input and an error I keep coming across. When I run this query, everything goes fine, and when it hits a duplicate email address it is savvy enough to not allow it. Awesome. "Duplicate entry 'generic@email.net' for key 2". However, I keep running into an issue where it will load all of the appropriate new email addresses that occur before the above mentioned dup in the list, but not after it hits the dup email. Any thoughts?
  4. PFMaBiSmAd, Thank you. That worked wonderfully.
  5. Hello. I would like to transfer information from one table to another. Currently, the code below works well. $result = mysql_query( "INSERT INTO table2 (name, email) SELECT firstname, email FROM table1 WHERE email='generic@email.com' ") or die(mysql_error()); However, I would like to add another layer of complexity but my effiorts have not worked well. I would like to add default information into 2 new fileds within table2 (registered & confirmed). In table 2, these should both defaul to a value of "1". My feeble attempt is below. $result = mysql_query( "INSERT INTO table2 (name, email, registered='1', confirmed='1') SELECT firstname, email FROM table1 WHERE email='generic@email.com' ") or die(mysql_error()); Any help would be appreciated.
  6. Nodral, I appreciate the response but that query didn't populate anything. I think it is on the right track, but am unable to execute it.
  7. For whatever reason, most browsers will not recognize the id although it is coded. I ended up removing any browser requirments from the backend, so now it works on all browsers.
  8. Pikachu2000 , It worked like a charm. as always, thank you.
  9. Hello. I am having difficult combining 2 functions. On their own, each works fine. I would like to sum all of the hours within a certain event type based on the current year. Year = in table as DATE type and formatted as 2011-05-01. My current code to sum the hours is: <?php include('dbconfig.php'); // Make a MySQL Connection mysql_connect("localhost", "$user", "$password") or die(mysql_error()); mysql_select_db("$database") or die(mysql_error()); $result = mysql_query("SELECT sum(hours) AS total_hours FROM event_schedule Where park = 'ParkA' ") or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "Hours Worked: "; echo $row['total_hours']; } ?> I was thinking of combining that with something similar to what's below but don't know how to. <?php $cur_year = date("Y"); echo $cur_year; ?> Thank you in advance.
  10. Hello. I have a simple enough code that takes information from one table and drops it into another. This is great, but I have 2a new complexities that I have been unable to code correctly. A. 'lastname', 'firstname' on table1 need to be combined into 'name' How & Where do I combine these strings and then pass them? <?php include('dbconfig.php'); // Make a MySQL Connection mysql_connect("localhost", "$user", "$password") or die(mysql_error()); mysql_select_db("$database") or die(mysql_error()); $result = mysql_query( "INSERT INTO table2 (lastname, firstname, email) SELECT lastname, firstname, email FROM table1 WHERE email='someemail@gmail.com' ") or die(mysql_error()); ?>
  11. I would think it would be considered a PHP issue if it works fine in plain HTML, but, because of an 'echo' or 'print' statement the outcome of functionality has changed.
  12. Pikachu2000, thank you for observing this post, but I have to disagree. This is not a HTML or JS issue. It is a php code issue in which the browser was not recognizing the textarea identification because of the single quotes. thank you. adriscoll
  13. Drummin, Thanks for catching that. That was quite a bonehead scrap to leave in there. Unfortunately, though, it didn't change the other browsers not reading it. I guess it's time to look into those other options.
  14. crmamx, i will be happy to look into those, but it doesn't exactly help me understand if my code is wrong. As i mentioned, this works for IE, but not the other browsers. thank you.
  15. Hello. I am using openWYSIWYG by openWebWare. It works great on IE but will not function on any other browsers. It gives the error message, "No text area found with the given identifier (ID: nletter)." I think this is because of how I coded it, but could use an expert opinion. Thank you in advance. <script language="JavaScript" type="text/javascript" src="openwysiwyg_v1.4.7/scripts/wysiwyg.js"></script></script> <script language="javascript1.2"> // attach the editor to a specific text area WYSIWYG.attach('nletter'); </script> <?php include('dbconfig.php'); // Make a MySQL Connection mysql_connect("localhost", "$user", "$password") or die(mysql_error()); mysql_select_db("$database") or die(mysql_error()); $adminmail="crew@xxx.com"; // Pass the event id variable $event_id=$_GET['id']; if(isset($_POST['submit'])) { $subject=$_POST['subject']; $nletter=$_POST['nletter']; if(strlen($subject)<1) { print "You did not enter a subject."; } else if(strlen($nletter)<1) { print "You did not enter a message."; } else { $nletter=$_POST['nletter']; $subject=$_POST['subject']; $nletter=stripslashes($nletter); $subject=stripslashes($subject); $lists=$_POST['lists']; $nletter=str_replace("rn","<br>",$nletter); //the block above formats the letter so it will send correctly. $getlist="SELECT * from volunteer WHERE event_id = '$event_id' "; //select e-mails in ABC order $getlist2=mysql_query($getlist) or die("Could not get list"); while($getlist3=mysql_fetch_array($getlist2)) { $headers = "From: $adminmail \r\n"; //unlock adminmail above and insert $adminmail for email address $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; //send HTML enabled mail $headers .= "MIME-Version: 1.0 "; mail("$getlist3[email]","$subject","$nletter",$headers); } print "Your Message Has Been Sent."; } } else { print "<form action='volunteer_send.php?id=".$event_id."' method='post'>"; print "Subject:<br>"; print "<input type='text' name='subject' size='20'><br><br>"; print "Message:<br>"; print "<textarea name='nletter' cols='50' rows='6'></textarea><br><br>"; print "<input type='submit' name='submit' value='submit'></form>"; } ?>
×
×
  • 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.