Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by taquitosensei

  1. It's possible. I'm just guessing that people won't help until it looks like you've tried something. Look up "OR" in mysql queries.
  2. you're overwriting the array each time through your loop so it's only giving you the last one. try this $link="/weblog/archive/"; $class="linked-day"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $days[$row['gl_date']] = array($link,$class))); }
  3. This is how I would do this. your database loop goes here { $link="/weblog/archive/".date("Y", strtotime($yourdatefield)."/".date("M",strtotime($yourdatefield))."/".sprintf("%02",date("d", strtotime($yourdatefield))); $class="linked-day"; $days[date("d", strtotime($yourdatefield))]['link']=$link; $days[date("d", strtotime($yourdatefield))]['cssclass']=$class; // OR if you don't need the keynames $days[date("d", strtotime($yourdatefield)))]=array($link,$class); }
  4. with a radio you can only select one out of the group that has the same name and the one that is selected gets returned.
  5. you need a where statement otherwise it updates all the rows in your table. It should probably be this mysql_query("UPDATE `game`.`users` SET `password` = '$password'" where `username` = '$username');
  6. so you want a link that opens a windows explorer for a remote computer that is not the server and not the client?
  7. mass update? As in many rows with the same informatio? Many rows with different information? More info is needed.
  8. Try this I forgot to add the concatenator after the php variable and I had mismatched single and double quotes. If this doesn't work just keep messing with it until it works. echo("<td><a href='main_more.php?spreadsheetid=" .$spreadsheetid.$row["spreadsheetid"] ."'><span class='text_bold'>Read</span></a><span class='text_bold'>||<a href='main_edit_admin.php?spreadsheetid=".$myrow.$spreadsheetid.$row['spreadsheetid']."'><span class='text_bold'>Edit</a></span><span class='text_bold'> || </a></span><a href='javascript:confirmDelete(\"main_delete_admin.php?spreadsheetid=".$myrow.$spreadsheetid.$row['spreadsheetid']."\");'><span class='text_bold'>Delete</a><br></span></td>"); There might still be a problem with the quotes in the javascript but you should get the idea.
  9. plus even if it's only one value $_POST['chk_email'] is an array. So you should have done print_r($_POST['chk_email']); but doing the whole post variable is better, gives you an idea of what is actually being passed.
  10. you are 90% there. That line is fine. When you post that your array would be $_POST['chk_email'] any that are checked would be there.
  11. I think you're a little overzealous in your quotage and concatenatation echo("<td><a href='main_more.php?spreadsheetid=" .$spreadsheetid.$row["spreadsheetid"] ."'><span class='text_bold'>Read</span></a><span class='text_bold'>||<a href='main_edit_admin.php?spreadsheetid=".$myrow.$spreadsheetid.$row['spreadsheetid']."'><span class='text_bold'>Edit</a></span><span class='text_bold'> || </a></span><a href='javascript:confirmDelete(\'main_delete_admin.php?spreadsheetid=".$myrow.$spreadsheetid.$row['spreadsheetid']\");'><span class='text_bold'>Delete</a><br></span></td>"); There might still be a problem with the quotes in the javascript but you should get the idea.
  12. radio buttons - only one can be checked. You would use the checked attribute for the correct one instead of the value from the post data. e.g. <input type="radio" id="rad0" tabindex="8" name="Frequency" value="One Time" CHECKED>One Time<br> so... <input type="radio" id="rad0" tabindex="8" name="Frequency" value="One Time" <?php echo ($_POST['Frequency']=="One Time")?"CHECKED":""; ?>>One Time<br> <input type="radio" id="rad1" tabindex="9" name="Frequency" value="Daily" <?php echo ($_POST['Frequency']=="Daily":"CHECKED":""; ?>>Daily<br> <input type="radio" id="rad2" tabindex="10" name="Frequency" value="Weekly" <?php echo ($_POST['Frequency']=="Weekly")?"CHECKED":""; ?>>Weekly<br> <input type="radio" id="rad3" tabindex="11" name="Frequency" value="Monthly" <?php echo ($_POST['Frequency']=="Monthly")?"CHECKED":""; ?>>Monthly<br> <input type="radio" id="rad4" tabindex="12" name="Frequency" value="Ongoing" <?php echo ($_POST['Frequency']=="Ongoing")?"CHECKED":""; ?>>Ongoing<br>
  13. an array would be just fine.
  14. put this in a php file that you include anywhere you'd need these define("YOUR_GLOBAL_VARIABLE_NAME","value");
  15. $new_date=date("Y-m-d H:i:s", strtotime("+1 Month"));
  16. something along these lines $names=array("Ben","Tom","George"); foreach($names as $name) { $result=mysql_query("select idfield from yourtable where namefield='".mysql_real_escape_string($name)."'"); if(mysql_num_rows($result))==0) { $names_not_in_database[]=$name; } }
  17. echo out tstamp and concat_next make sure they're both timestamps. If one is a datetime then use the strtotime on that one.
  18. it looks like you're data is already a timestamp so you can lose the strtotime's
  19. I thought I was looking at the php forums when I posted that....thus my edit.
  20. I would store it as a datetime then in php you can do the math to get how many days. $today="2010-04-05"; $time_next="2010-04-28"; $timediff=(strtotime($time_next)-strtotime($today)); $minutes=$timediff/60; $hours=$minutes/60; $days=ceil($hours/24);
  21. probably a union $sql=" select yourfields from yourtable where `MONTH` >='".$data_lastfs."' UNION select yourfields from yourtables where MONTH < '".$data_lastfsend."'"; o r an or would probably work in this case $sql=" select yourfields from yourtable where `MONTH` >='".$data_lastfs."' or `MONTH` < '".$lastfsend."'";
  22. nm I'm an idiot
  23. It's your database layout. Nobody here would have any idea. You should know long before starting on the php what your keys are in your tables and what they correlate to in other tables.
  24. and you're mixing up your single and double quotes $prospectEntries = mysql_query('SELECT * from prospects ORDER BY ".mysql_real_escape_string($orderby)." DESC '.$queryLimit) or trigger_error(mysql_error()); should be $prospectEntries = mysql_query("SELECT * from prospects ORDER BY ".mysql_real_escape_string($orderby)." DESC ".$queryLimit) or trigger_error(mysql_error());
  25. $dead is a database result you need to get the value from it $result_dead=mysql_query("SELECT * FROM `players` WHERE `status` == 'dead'"); while ($row_dead = mysql_fetch_array($result_dead, MYSQL_ASSOC)) { $dead=$row['owner field from players']; } mysql_query ("DELETE FROM `garage` WHERE `owner` = '$dead'")
×
×
  • 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.