Jump to content

ale8oneboy

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by ale8oneboy

  1. Does $extension = ".png"; ?
  2. Take a look at the include() function. It allows you to include one file in another file. http://php.net/manual/en/function.include.php In your index.php file you would have a line that says: <?php include("content.php"); ?>
  3. If you host provides the GD extension for PHP. You can use some of the features of GD to process images however you like. Another alternative is the imagick package. Both have to be supported by your host's installation of php. http://php.net/manual/en/book.image.php http://php.net/manual/en/book.imagick.php
  4. Take a look at this line: <p>Property Name: <input name= <?php echo $updateproperty['PropertyName']; ?> type="text"></p> I believe your wanting to populate the value instead of the name. Maybe rewrite as: <p>Property Name: <input name="PropertyName" value="<?php echo $updateproperty['PropertyName']; ?>" type="text"></p> Did that work?
  5. Exactly!
  6. Not as bad as you think. You can pull this task off with using multiple table query with table aliases. SELECT a.date, u.fullname, c.company, a.activity, a.followup_date FROM users u, customers c, activity_log a WHERE u.user_id = a.user_id AND c.cust_id = a.cust_id Just fill in the rest of the where clause and you should be good to go. This may not be the most efficient way to do it. But it will get the job done. Use it as a stepping stone to using multiple table joins.
  7. I would try finding the field names by using the mysql_field_name() function. Maybe try writing a dummy script to find the field names. http://php.net/manual/en/function.mysql-field-name.php You could also use the "DESCRIBE" function in MySQL in a script. http://dev.mysql.com/doc/refman/5.0/en/describe.html
  8. I agree. I've stored using the local time of the server and converted before. It's not fun when you forget to change server time zones later.
  9. This may not be the best way to handle this. But you could try creating a database view of upload counts. Then update your users table from the upload counts view. Example: 1) The View: CREATE ALGORITHM = MERGE VIEW v_upload_counts AS SELECT user_id, count(*) AS uploads FROM files GROUP BY user_id 2) The Update Query: UPDATE users u JOIN v_upload_counts c ON u.user_id = c.user_id SET u.uploads = c.uploads This is just an idea. Anyone else have a better idea?
  10. From my understanding is that preg_match is the alternative replacement. http://www.php.net/manual/en/function.preg-match.php
  11. That would work. But you also need something in php to call the function. Maybe try adding. <?php if($_POST['action'] == 'eventbooker') { eventbooker(); } ?>
  12. I tried creating an account. I got a MySQL insert error. Incorrect date value: '11' for column 'date_of_birth' at row 1errore inn :insert into user (name, last_name, sex, date_of_birth, date_registered, city, canton, email, password, username ) values ('ale8oneboy@phpfreaks', 'phpfreaks.com', 'm', 1971/12/15 , CURDATE(), 'Test City', '', '[email protected]', 'phpfreaks', 'ale8oneboy@phpfreaks' )
  13. Where is the function call for eventbooker()?
  14. I agree. This would be better off done through a query. What are you trying to do with this script?
  15. Try changing your query to the following: $db=mysql_query("UPDATE users SET location = '$page' WHERE userid=".$ir['userid']);
  16. Take a look at the 'in_array()' function. Walk through your first array with a for each loop. Have it check to see if the current value exists in the second array. Throw the unique values into another array. http://php.net/manual/en/function.in-array.php
  17. I agree with MrAdam. I was going to suggest the same. Using the date() function, convert the timestamp to just a date and compare the dates. Lose Example: <?php //today echo date("m/d/y")."<br><br>"; //April 1st 1971 echo date("m/d/y","39393992")."<br><br>"; //is today after April 1st 1971? if(date("m/d/y","39393992") < date("m/d/y")) { echo "Today is after 04/01/71."; } ?>
  18. Let me give you a little sample code based off what you've given. This isn't the full code. You'll need statements to connect to the database. But this will display the information in the format you're looking for. $sql = "SELECT severity, count(*) FROM defects GROUP BY severity"; $result = mysql_query($sql); while($row = mysql_fetch_array($result, MYSQL_NUM)) { echo "$row[0]: $row[1]"; }
  19. I'm not sure exactly how your table is designed. But from what I gather, you could do single query to get the data you need. Try something like: $sql = "SELECT name, count(*) FROM defects GROUP BY name"; This query would result with each name, and the count of that name. If that doesn't help. Try posting a copy of your table and I may be able to help you better.
  20. Recheck the function definition of mail(). mail ( string $to , string $subject , string $message , string $headers ); Change: mail($webMaster, $emailField, $emailSubject, $body, $headers); To: mail($emailField, $emailSubject, $body, $headers); You can specify the sent from address in $headers. Example: $header = "From: $webMaster\n\n"; $headers .= "Content-type: text/html\n\n"; Hope that helps!
×
×
  • 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.