Jump to content

TRI0N

Members
  • Posts

    215
  • Joined

  • Last visited

Everything posted by TRI0N

  1. Not sure about Ajax but this can easily be done with FancyBox jQuery with href new_query.php?id=### with a MySQL Query to pull from another database. http://fancybox.net/ Example on top row middle effect is nice to use for such things.
  2. For starters I see this '$_POST' which should be $_POST['email'] also email tends to be a script call and usually never works on a lot of out of box setups. So change that to $_POST['e_mail'] and all references of email to e_mail.
  3. MySQL does not like users using root as the connections for Query's outside of PHPMySQL and in some instances does not allow you to connect with root at all via different providers. I would assume that once you get your MySQL up and running that you create a user for external queries and use root for Administration Only.
  4. TRI0N

    mysqli count

    $i = 0; $result = $mysqli->query("SELECT COUNT(Gender) FROM table where Gender = 'F'"); $i = $i + 1 ; $Female = $result->fetch_row(); Echo $i for your counter...
  5. Your best bet is to just use this: http://www.adamek.biz/md5-generator.php Type in a new password and get the MD5 and replace the old one with the new one generated.
  6. TRI0N

    date format

    I just noticed your original date format is 1/15/2013 The correct code to convert: $my_date_format = '1/15/2013' ; $date_fix = explode('/', $my_date_format) ; $new_month = $date_fix[0] ; $new_day = $date_fix[1] ; $new_year = $date_fix[2] ; $new_date_to_store = $new_year.'-'.$new_month.'-'.$new_day ; The correct code to display: $db_date_format = $row['date'] ; $date_fix = explode('-', $db_date_format) ; $new_year = $date_fix[0] ; $new_month = $date_fix[1] ; $new_day = $date_fix[2] ; $new_date_to_display = $new_month.'/'.$new_day.'/'.$new_year ; echo $new_date_to_display ; That will do the trick!
  7. TRI0N

    date format

    The only problem that storing dates in VARCHAR is that PHP Date functions have more flexibilities when you wish to short or calculate dates in the correct date format. If you do this those functions will not work like they should if the date is not in its standard format.
  8. TRI0N

    date format

    You will need to explode your m-d-Y to Y-m-d before inserting or updating into your database. $my_date_format = '1-15-2013' ; $date_fix = explode('-', $my_date_format) ; $new_month = $date_fix[0] ; $new_day = $date_fix[1] ; $new_year = $date_fix[2] ; $new_date_to_store = $new_year.'-'.$new_month.'-'.$new_day ; $new_date_to_store is the date format you will want to store into your database. Then you will need to do the exact same thing to reverse the date upon SELECT to parse it to the format you want to see when viewed on a page. $db_date_format = $row['date'] ; $date_fix = explode('-', $db_date_format) ; $new_year = $date_fix[0] ; $new_month = $date_fix[1] ; $new_day = $date_fix[2] ; $new_date_to_display = $new_month.'-'.$new_day.'-'.$new_year ; echo $new_date_to_display ;
  9. Okay here is what I have in the works. What I want to achieve is the ability to update the order of items in a database upon change and if an item is moved from one tab to another it will update as well. <?php include ('global.php') ; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>IT WHITEBOARD</title> <link rel="stylesheet" href="css/jquery-ui.css" /> <script src="jquery-1.8.3.js"></script> <script src="jquery-ui.js"></script> <style> #sortable1 li, #sortable2 li, #sortable3 li, #sortable4 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 100%; } </style> <script> $(function() { $( "#sortable1, #sortable2, #sortable3, #sortable4" ).sortable().disableSelection(); var $tabs = $( "#tabs" ).tabs(); var $tab_items = $( "ul:first li", $tabs ).droppable({ accept: ".connectedSortable li", hoverClass: "ui-state-hover", drop: function( event, ui ) { var $item = $( this ); var $list = $( $item.find( "a" ).attr( "href" ) ) .find( ".connectedSortable" ); ui.draggable.hide( "slow", function() { $tabs.tabs( "select", $tab_items.index( $item ) ); $( this ).appendTo( $list ).show( "slow" ); }); } }); }); </script> </head> <body> <div id="tabs"> <ul> <li><a href="#tabs-1">Emergency Tasks</a></li> <li><a href="#tabs-2">Priority Tasks</a></li> <li><a href="#tabs-3">Issues List</a></li> <li><a href="#tabs-4">Completed Tasks</a></li> </ul> <div id="tabs-1"> <ul id="sortable1" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result1 = mysql_query("SELECT * FROM tasks WHERE priority = 'Emergency' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result1)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result1) ; ?> </ul> </div> <div id="tabs-2"> <ul id="sortable2" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result2 = mysql_query("SELECT * FROM tasks WHERE priority = 'Priority' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result2)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result2) ; ?> </ul> </div> <div id="tabs-3"> <ul id="sortable3" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result3 = mysql_query("SELECT * FROM tasks WHERE priority = 'Issues' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result3)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result3) ; ?> </ul> </div> <div id="tabs-4"> <ul id="sortable4" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result4 = mysql_query("SELECT * FROM tasks WHERE priority = 'Completed' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result4)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result4) ; ?> </ul> </div> </div> </body> </html> I have also attached the CSS file if needed. All other .js files are standard jQuery Libary.
  10. Here is what I'm attempting to do. I have a rectangle that fixed on a page and is 170 wide and 32 Height, I want to :hover to make an image 170 x 170 slide up from the rectangle when mouse in on over. Then of course collapse when the on mouse out. I have looked all over for this but only get a collapse div answer to make the rectangle grow but that is not my objective. Any help greatly appreciated.
  11. Yep and now with the Full Opening Tags the data is parshing just as it should. Thanks.. Oh and I was refering to other help as not being helpful. Yours help was right on the money.
  12. Yep that was it.. php.ini is setup for strict PHP and the Tags where the reason. Good reason to. I will just go back into my work and make sure all tags are pressent. Thanks a ton PFMaBiSmAd! I knew my php setup was good and very secured so missing the tags threw me off.
  13. If what you think is a setting in php.ini then point me to it. But the above didn't help much and any changes to things I always run service httpd restart.
  14. Here is what the PHP code looks like that outputs the above into the page when viewed: <? // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname3") ; // Check Events in Events Database $result1 = mysql_query("select distinct * from cdc_sales WHERE processed = '0'") ; while($row = mysql_fetch_row($result1)) { echo '<a href="purchase_details.php?id='.$row[0].'">'.$row[2].', '.$row[1].'</a><br>' ; } // Close Database Connection mysql_close(); ?> </td> </tr> <tr> <td> </td> </tr> <tr> <td>Gift Certificate Purchases:</td> </tr> <tr> <td> <? // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname3") ; // Check Events in Events Database $result2 = mysql_query("select distinct * from gift_certs WHERE processed = '0'") ; while($row = mysql_fetch_row($result2)) { echo '<a href="purchase_gc_details.php?id='.$row[0].'">'.$row[1].' :: '.$row[12].' :: '.$row[13].' :: '.$row[14].'</a><br>' ; } // Close Database Connection mysql_close(); ?> Best regards, TRI0N
  15. Actually it's setup correctly just securly with alot of things disabled. I'm sure it's just a simple setting to get this going again.
  16. Hey all I just replaced all our main gateways that house all our LAN based office PHP Apps I have made and the issue is that database parsing is not working like they did on the older systems. I currenly have PHP 5.3.3 and MySQL 5.1.66 and the code is outputting this on the screen rather then the $row[x] from the database. I'm sure this is a simple fix in the configuration somewhere to get these pages working again on the new setup. Annual Discount Card Purchases: '.$row[2].', '.$row[1].' ' ; } // Close Database Connection mysql_close(); ?> Gift Certificate Purchases: '.$row[1].' :: '.$row[12].' :: '.$row[13].' :: '.$row[14].' ' ; } // Close Database Connection mysql_close(); ?> Any help getting this to parse the data correcly and not print my code would be excellent. Remember nothing about the old working code has changes this is simple running the old PHP files on MUCH newer PHP and MySQL Versions. Best regards, TRI0N!
  17. Hey there I'm currenlty trying to get a cron to execute a php file at 1 mintue after midnight. The php script works just fine however it is doing nothing inside cron. 01 0 * * * wget http://www.pgecafe.com/-pick-winner-.php Just entering wget http://www.pgecafe.com/-pick-winner-.php at command line works just fine. So why is it not working from crontab?
  18. Sucess!! It was in the 3rd while statement. I also removed $i = div1; at the start of the second DIV since $i is already a running total. Here is the final code that does the job. <?php // Database Connection mysql_connect("$dbhost2","$dbuser2","$dbpasswd2") ; // Database Selection mysql_select_db("$dbname2") ; // Fetch Venues $results2 = mysql_query("select distinct * from venues ORDER BY venue ASC") ; $i=0; while($row = mysql_fetch_array($results2)) { $temp_array[$i] = $row['venue']; $i ++; } $total_elements = count($temp_array); $div1 = ceil($total_elements/2); $div2 = $total_elements - $div1; echo '<div class="left-box"><ul>'; $i = 0; while($i<$div1) { echo '<li>'. $temp_array[$i] . '</li>'; $i ++; } echo '</ul></div>'; echo '<div class="right-box"><ul>'; while($i<$total_elements) { echo '<li>'. $temp_array[$i] . '</li>'; $i ++; } echo '</ul></div>'; // Close Database Connection mysql_close(); ?> Thanks a ton for all your help in getting this working.. Excellent!
  19. Before Right DIV the totals are: $i and div1 = 39 $div2 = 39 After Right DIV: $i = 39
  20. Correct... I think it lies in the $i counter after the first div.
  21. Okay the Left Box is working.. The right box however has no output.. Here is the code I formated: $results2 = mysql_query("select distinct * from venues ORDER BY venue ASC") ; $i=0; while($row = mysql_fetch_array($results2)) { $temp_array[$i] = $row['venue']; $i ++; } $total_elements = count($temp_array); $div1 = ceil($total_elements/2); $div2 = $total_elements - $div1; echo '<div class="left-box"><ul>'; $i = 0; while($i<$div1) { echo '<li>'. $temp_array[$i] . '</li>'; $i ++; } echo '</ul></div>'; $i = $div1; echo '<div class="right-box"><ul>'; while($i<$div2) { echo '<li>'. $temp_array[$i] . '</li>'; $i ++; } echo '</ul></div>';
  22. Under a hundred is more realistic.
  23. I get a list of all the venues with their ID and Venus Name. There was just a slight error so it took me longer to respond. The Fetch had result2 not results2 in your example to use.
  24. 1-78 Auto Increasement Field.
  25. Okay if I just toss in a "echo $total_elements;" in there I get a results of 1 showing.. There is 78 Venues in that database so something not right...
×
×
  • 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.