Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

madjack87's Achievements


Member (2/5)



  1. Its very random when it does and doesnt work. Even when doing the exact same steps. The array that is being printed is always correct. I see no problem in the SQL queries that are stored in the array. When I tried to add error checking before I received no errors.. What do you mean by I should be using a prepared query?
  2. I am using jquery and ajax to have a drag and drop sortable table. My problem is that it only works about 10 percent of the time. Here is my js code. <script type="text/javascript"> // When the document is ready set up our sortable with it's inherant function(s) $(document).ready(function() { $("#test-list").sortable({ handle : '.handle', update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("tow_sort2.php?"+order); } }); }); </script> Here is the tow_sort2.php page: <?php include("../_includes/db_connection.php"); /** * This is where you would inject your sql into the database * but we're just going to format it and send it back */ $array =array(); foreach ($_GET['listItem'] as $position => $item) { $sql = "UPDATE tow SET tow_order = '$position' WHERE tow_id = '$item'"; $conn->query($sql); $array[] = $sql; } print_r($array); ?> Here is the array that is being printed: Array ( [0] => UPDATE tow SET tow_order = '0' WHERE tow_id = '5924' [1] => UPDATE tow SET tow_order = '1' WHERE tow_id = '5925' [2] => UPDATE tow SET tow_order = '2' WHERE tow_id = '5922' [3] => UPDATE tow SET tow_order = '3' WHERE tow_id = '5923' )
  3. Well in my case there are multiple users per company. They all access their companies data.. What if I want to add a completely seperate company, but I want it to be at the same URL / domain. Do I create a new folder and database for each company? I already have the system built for one company with many tables all relational. We have been using it for two years. What my question is if I want to sell this where other companies can create an account and have there own system for their company how do I go about doing that. That is where the multiple database questions come in.
  4. I am not sure what to look for to even get started. If some one could help point me in the right direction that would be appreciated. I created a customer system that tracks contracts and invoices ect. Where do I start if I would want a customer to be able to go to the website, sign up, and their own version of the system would be created. Do I just write a script that creates a new database with the correct credentials? Do all of the users access the same files but just have different database. Do I have to copy the directory of files to a specific folder for each customer? I know there must be tons of websites that once you sign up for example a calendar app that keeps your data seperate from everyone else. Any help is appreciated. Thanks Jack
  5. I am trying to find a way to save a still of live streams. I am on a shared server so I do not think it is possible that I install anything like ffmpeg. Is this even possible with PHP? or even JS or any web language? I have been searching all over the place and cannot seem to find anything that can do this. Any help would be appreciated, even if it is just pointing me in the correct dirrection.
  6. Worked Like a Charm! Also cleaned my code up a lot! JCBones I will look into preg_replace_all for future use. Thank you.
  7. What I am doing is displaying a message to another user on the company system. This is Test 1 [20345] The above data is what is stored in the database. What I want to acheive is when I echo the field for it to do this: This is Test 1 [<a href="http://mywebsite.com/system/page1.php?number=20345">20345</a>] I currently am able to make this work. However I cannot get it to work on multiple links. $message_message = $row['message_message']; preg_match("/\[(.*)\]/", $message_message , $matches); $match = $matches[1]; $parts = explode ("[", $message_message); $part1 = $parts[0]; $part2 = $parts[1]; $subparts = explode ("]", $part2); $part3 = $subparts[1]; if ($match != ""){ $new_message_text2 = $part1 . "[<a href=\"http://mywebsite.com/system/page1.php?number=$match\">$match</a>]" . $part3; }else{ $new_message_text2 = $message_message; } When I have data like this: This is Test 2 [20345] [20552] I get a result like this: This is Test 2 [<a href="http://mywebsitecom/system/page1.php?number=20345] [20552">20345] [20552</a>]
  8. Im pretty sure this can be done with mysql concat. The reason that I need it to be completed within the query is because I am searching for the terms.
  9. Below is my query: <?php if (isset($_POST['search_all_submit'])){ $search_all = strtolower($_POST['search_all']); echo "<table id='qbook'>"; echo "<tr>"; echo "<td> CID </td>"; echo "<td> Company </td>"; echo "<td> Property </td>"; echo "<td> Contact </td>"; echo "</tr>"; $sql = " SELECT contract.*, customer.*, contact.* FROM customer INNER JOIN contract ON customer.customer_id = contract.customer_id INNER JOIN contact ON customer.customer_id = contact.customer_id WHERE customer.company_name like '%".$search_all."%' or customer.billing_address like '%".$search_all."%' or contract.prop_name like '%".$search_all."%' or contract.prop_address like '%".$search_all."%' or contact.contact_fname like '%".$search_all."%' or contact.contact_lname like '%".$search_all."%' "; $results = mysql_query($sql)or die(mysql_error()); while ($row = mysql_fetch_array($results)){ $company_name = implode('<span class="high">'.$search_all.'</span>',explode($search_all,strtolower($row['company_name']))); $billing_address = implode('<span class="high">'.$search_all.'</span>',explode($search_all,strtolower($row['billing_address']))); $prop_name = implode('<span class="high">'.$search_all.'</span>',explode($search_all,strtolower($row['prop_name']))); $prop_address = implode('<span class="high">'.$search_all.'</span>',explode($search_all,strtolower($row['prop_address']))); $fname = implode('<span class="high">'.$search_all.'</span>',explode($search_all,strtolower($row['contact_fname']))); $lname = implode('<span class="high">'.$search_all.'</span>',explode($search_all,strtolower($row['contact_lname']))); $CID = $row['CID']; echo "<tr>"; echo "<td> $CID </td>"; echo "<td> $company_name <br /> $billing_address </td>"; echo "<td> $prop_name <br /> $prop_address </td>"; echo "<td> $fname $lname</td>"; echo "</tr>"; } echo "</table>"; } ?> The query above gives me results like: 10008 | jw property management | creekside crossing | mike pudelek | 4816 green bay rd | 9219 66th ave | 10008 | jw property management | creekside crossing | sam johnson | 4816 green bay rd | 9219 66th ave | 10008 | jw property management | creekside crossing | dean zierk | 4816 green bay rd | 9219 66th ave | What I would like to see is: 10008 | jw property management | creekside crossing | dean zierk | 4816 green bay rd | 9219 66th ave | mike pudelek | sam johnson I am pretty sure that I need to use some type of GROUP CONCAT and possibly a GROUP BY. However all of my attemps have failed. Any help would be appreciated.
  10. Sometimes its the simplest things that hold me up in coding. didnt even realize that you could count($_POST); I will give this a try and go from there. Thanks
  11. Current I have php create a form element for every entry found in the database that meets certain criteria. On the form submit it submits information about each form element and can be anywhere from 1-20 elements. The issue that I am having is when I try to gather the day from $_POST I do not know how many form elements are being sent over. So I end up typing something like this. $form_element_1 = $_POST['form_element_1']; $form_element_2 = $_POST['form_element_2']; $form_element_3 = $_POST['form_element_3']; And I type that out for as many as I think I need. But as soon as I need 4 elements I have to go and recode that page to accept more elements. I hope that I am asking this question properly. Thanks Jack
  12. Thanks Denno, I thought of this approach but wasnt sure if it was the best method. I also wasnt sure if it would cause any issues with all of the different browsers out there. Thanks again for you help As always it is much appreciated.
  13. I am not sure what is the best way to layout this design with Divs. As you can see the navigation is split in the middle from the logo. Any help would be greatly appreciated. Thanks
  14. Thanks for the Feedback. I dont have a mind for design as much as I wish I would.. I am more of a programmar than a designer so any feedback is appreciated!
  15. http://asphaltinc.com Let me know what you think Thanks
  • 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.