Jump to content

allworknoplay

Members
  • Posts

    385
  • Joined

  • Last visited

    Never

Everything posted by allworknoplay

  1. Ok, yeah I think wordwrap function is really only good when you are trying to keep a sentence to a minimal and wrapping the extra words to the next line. Your issue is that you have ONE word that is long.. I don't think wordwrap function will breakup your text....am I correct? Use this: ### Start StringTrim $string_count = strlen($name); if($string_count > 32) { $new_name = substr("$name", 0, 29); $new_name .= "..."; $name = $new_name; } ### End StringTrim You can set the "32" to whatever you want. And the "29" gives you the three dots (...)
  2. Hi Codemama, I am onto your issue. A couple things I found. 1) Your use of short tags is now deprecated so for the Location and WorkorderName, just do this: Near line 371: <tr> <td align="left" nowrap><div class="CaptionReq">Property:</div></td> <td align="left"><div><input type="text" name="Location" value="<? echo $qryLocation ?>"></div></td> </tr> Near line 381: <tr> <td align="left" nowrap><div class="CaptionReq">Work Order Name: </div></td> <td align="left"><div><br><input type="text" name="WorkOrderName" value="<? echo $qryWorkOrderName ?>" size="35 " /></div></td> </tr> Also, when you submit the form, I don't see anywhere, where you are grabbing the actual variables for insert. You need to have these POST variables near the top of your script. $insert_location = $_POST['Location']; $insert_workordername = $_POST['WorkOrderName']; Then use the 2 variables I created for you, in your SQL insert statements...
  3. I understand where you are coming from. But wouldn't this make designing the layout extremely difficult? My websites, as well as others have nested HTML tags within HTML tags, with javascript all over the place... At least by using something like Dreamweaver I can visually create the layout and put PHP in "pockets" of areas where it needs to be. I have always been curious myself what exactly is the right design if there even is any? I thought that proper framework design was to take the logic out of the design and keep them separated......?
  4. Honestly, I'm not sure why my SQL doesn't work for you. It should give you all the info from both tables where the site_id = 25... Not sure why it would just output only ONE of the tables.........
  5. The insert statement looks perfect to me! i can't see any reason why it wouldn't work.... especially since you said that you CAN echo out the variables, so they aren't being lost anywhere... mind boggling....
  6. hmmm, the WorkOrderID is auto_increment so you can take that out, I take it though that you don't have it in there but you just wanted to show me? So it should be: $sql = "INSERT INTO workorders (CreatedDate, Location, WorkOrderName, AdminID, FormName, Status, Notes) VALUES ("; $sql .= "Now(), '$Location', '$WorkOrderName', '$AdminID', 'WorkOrder', 'New Order', '$Notes')"; mysql_query($sql); $WorkOrderID = mysql_insert_id(); BUT, I don't see that WorkOrderID is set to "auto increment" in your table description?
  7. That's a pretty nice looking site. But WOW, that's a long list fella!!!
  8. Great! So you ARE getting the variables, that's the good part so they aren't getting lost... Then it's your INSERT statements..I'm telling you, did you look at your DB structure???
  9. Right, you never said what table you want the 25 on... I don't think you can just say site_id=25, you would get an ambiguous error...
  10. Hmm well this is a shot in the dark.. $query = "SELECT * FROM tbl_customers, tbl_sites WHERE tbl_customers.customer_site = tbl_sites.site_id AND tbl_sites.site_id = '25' ";
  11. If fact, I would echo out all the variables that you want to do the INSERT on and start debugging that way... You can just comment out the actual query so you don't end up inserting a bunch of records just for testing.. Once you are getting all the variables you need, then uncomment the query and see if it goes into the DB...
  12. I would check how your SQL insert is structured as well as the table stucture itself...again, there could be unique field combo's that it's not allowing....
  13. lol you could have just bumped your other thread!!
  14. dude, you already have a thread on this, why did you make a new one?
  15. good job! Although I am confused why it's nitpicking which columns it allows you to update? Why is Location and Workordername not being allowed to input?
  16. You can do it that way but I'm unfamiliar with using date as the column type in MYSQL. that's why i said I use int(10) and then put int he date as a unix timestamp value. As for displaying dates, that's easy: 'Thu-19-2009' = date("D-d-Y") So the correct format is: $mydate = date("D-d-Y",$timestamp_from_db);
  17. that sounds about right. When I do my dates in mysql, I just make the columns INT(10) and put in the timestamp using PHP's time() function. Then when I pull the data out, I use the date() function to properly display the date. By using timestamp, you cover everything, the date as well as time... Ok, so I've added a time field to the database, but I'm not really sure how I would quiery the database to do it for the date and time? Would it be; $DB_Query = @mysql_query("SELECT * FROM `uknews` ORDER BY date AND time DESC LIMIT 5") OR die('MySQL error: '.mysql_error()); No, that has to be wrong, lol! No problem, can you show me your table structure?
  18. that sounds about right. When I do my dates in mysql, I just make the columns INT(10) and put in the timestamp using PHP's time() function. Then when I pull the data out, I use the date() function to properly display the date. By using timestamp, you cover everything, the date as well as time...
  19. hmm...pardon my newbieness but i'm not sure what that means, I don't think they are Unique tables (how could I tell) because I could manually make the order and it would submit. On the good side of things I just got an update from the boss that the only 3 fields that need to be generated for a new/duplicated order, are from her email: "An exact duplicate with new work order number and blank start date, end date and io# " So maybe I can get it to work by making more of the fields...I don't know I'm getting lost on this...it seemed like it should of been so easy to do. Ok, yeah this is pretty easy really. Depending on the table structure, it might not allow for duplicate data in the fields like this: workorder_id, username, position So workorder_id would be unique, but then the table structure might say that (workorder_id, username) would be a unique combo. So you you can't have say: Workorder ID#: 1000 username: johndoe And another record that's the same: WorkorderID#: 1000 username: johndoe Again, I'm only guessing... You can do a SHOW CREATE "table" in your mysql, to find out how your table is structured...
  20. I use Dreamweaver and it doesn't lock files. However if you make changes to it from another program, it will detect it once you go back to DW. Other than that, i still don't know what the OP wants to do...
  21. Ok I think I understand what you're trying to do. Yeah this should be pretty simple. You are already pulling the data from the DB and presenting it on the form. Somehow though, the data is getting lost when you are creating the new record. Is it possible that you have UNIQUE tables created that won't allow you to post certain fields that are the same?
  22. Yeah that is quite a bit of code... Ok, so create a new page that has all the fields you want. The new EDIT page or COPY page would take in any fields you want already filled in, and for the other fields that you want the lazy sales people to fill in, make those blank... My question is, do the users have the choice of what they want already pulled out of the DB or will that be hardcoded?
  23. HMMM....you learn something new everyday!
×
×
  • 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.