Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by dbrimlow

  1. I don't know if this can be done. I have data dumps that are uploaded via a 3rd party. They upload the .psv file into a folder a few times daily similar to this: >>/usr/home/master/usr/home/somefolder/somedatadump.psv<< I have a crontab that runs a few times daily to open mysql and run a command .sql file similar to this: >>* * * * /usr/home/master/usr/local/bin/mysql -u uname -p pword < /usr/home/master/command/command.sql 1> /dev/null<< The command.sql file is basic like this: >>use somedatabase; drop table if exists sometable; CREATE TABLE sometable ( numb int(10) unsigned NOT NULL default '0', ai varchar(15) default NULL, etc char(3) default NULL, and_so_on char(3) default NULL, PRIMARY KEY (numb) ); load data infile "/usr/home/master/usr/home/somefolder/somedatadump.psv" into table sometable fields terminated by "|";<< Okay. This works fine. The problem is, @ twice a year the 3rd party "file system" gets full; when this happens it uploads blank "somedatadump.psv" files. This obviously drops the old table and creates it anew with no data. I would like to be able to check the "somedatadump.psv" file to be sure it has data before dropping and recreating the table. I don't know if I can do a comparison in the beginning of the "command.sql" file, something like this: >> if "/usr/home/master/usr/home/somefolder/somedatadump.psv" NOT NULL ; use somedatabase; drop table if exists sometable; CREATE TABLE sometable ( numb int(10) unsigned NOT NULL default '0', ai varchar(15) default NULL, etc char(3) default NULL, and_so_on char(3) default NULL, PRIMARY KEY (numb) ); load data infile "/usr/home/master/usr/home/somefolder/somedatadump.psv" into table sometable fields terminated by "|";<< Not sure what syntax applies or if "else" is required. Thanks, Dave
  2. I changed @ 10 of my php pages back to html. I revised the pages with pure css layout and converted the navbar includes insert to an external jscript navbar write. What I want to do is have anyone who bookmarked the php versions of the pages auto-redirected to the new html versions. I am temporarily using a redirect link within the php pages themselves. Thanks, Dave
  3. You want to use "name based hosts" as follows: <virtualhost www.cmcdaniel.com> documentroot c:\apache2\htdocs\cmcwebsite servername www.cmcdaniel.com </virtualhost> <virtualhost www.awesomeframes.com> documentroot c:\apache2\htdocs\awesomeframes servername www.awesomeframes.com </virtualhost> It is tricky on local binary systems (self installed AMP or phptriad or WAMP). But it should work. You may have to turn on the name based Vhost mod. This is assuming that the 2 sites are folders with full websites contained within. If you have one website set up in htdocs, and a folder for the other it will not work.
  4. I have two tables that are exactly the same in stucture. table 1 gets populated by an auto dump sent via a custom 3rd party inhouse application. It works fine for 90% of our tables, but for one table the application is limited ... so I created a manual table to allow showing the same array as all the others. table 2 is manually populated, to provide data in fields not usually included in table 1 dump. I then have 2 sets of arrays that search both tables for the same content, and defines how it should display on the page in a description and in a bulleted amenities list. eg: Table1 select includes - if ($myrow[coop] == "COOPERATIVE") { $description .= ", COOP"; $building[]="Cooperative"; } if ($myrow[coop] == "CONDOMINIUM") { $description .= ", CONDO"; $building[]="Condominium"; } if ($myrow[coop] == "CONDOP") { $description .= ", CONDOP"; $building[]="Cond-Op"; } etc., etc. Table2 select includes: if ($mytownhouse[bldg_type] == "townhouse") { $description .= ", TOWNHOUSE"; $building[]="Townhouse"; } if($mytownhouse[bldg_type] == "brownstone") { $description .= ", BROWNSTONE"; $building[]="Brownstone"; } etc., etc. This worked fine for the first year or so, it would provide data missing in table 1 with data from table 2. But now, after a recent upgrade of our custom app., the dump is including some of the data that was missing from table1. So now, I am getting duplicate amenities. These conditional arrays are both HUGE lines of text - easily spanning over 800 lines of code. What I want know, is if there is an EASY way for me to exclude any duplicates among the tables from displaying, and set one table as the default source in the event of a duplicate? I can compare each and every field and if both have data, ignore one or the other, but there MUST be a simple tables wide compare statement. Something like: if (($myrow[$building()] !="") && ($mytownhouse[$building()] !="") { $building()=$mytownhouse [$building()]; } I don't know if I explained this coherently or not, and I don't think the above would work. Dave
  5. This is also a cool little hack I found online to center a website using css. body{ margin: auto; text-align: center; } //then put your entire site in a containing div: #containall{ background-color:#fff; width: 800px; text-align:left; margin: 0 auto; } Works fine in IE and FF. You can even take a header out of the container and have it .
  6. You are using an "xhtml" doctype, yet your tag level coding is an amazingly frightening jumble of improper xhtml and html 4.0. On a quick check, there are 198 tags that need to be fixed to work as an xhtml. And THAT is only tags. You are also missing a content type meta charset (<meta http-equiv="Content-Type" content="text/html; charset=iso-utf-8" /> In other words ... it is not valid xhtml. It is ignoring almost every rule of xhtml. There should be no capital tag level code. All tags should close ("<BR>" is as wrong as you can get in xhtml. It should be "<br />". And that is only the tip of the iceberg. This following NOT valid xhtml OR html 4.0!: <IMG SRC="/images/home/faststreambanner3.gif" alt="" width="564" height="176" border=0 valign=top> (IMG SRC should be img src, and alt="" should never be empty or missing! all measurements must be something "564" is nothing ... "564px" is something. border=0 is REALLY nothing (even in html 4.0) ... border="0px" is something in html 4.0, there is no such thing as valign=top and "height" should never, NEVER be anywhere in your body tag whatsoever ... it is exclusively a css style. This is how it would work in xhtml - it should all be in the css under a class div like .faststreambanner img { width: 564px; height: 176px; border:0px: padding:0px; margin:0px; } This is even worse: <div style="border: 2px; #FFFFFF" class="section"> <a class="item2" href="/expressstripe.html">ExpressStripe</a> <a class="item2" href="/expraid.html">ExpressRaid</a> <a class="item2" href="/xtend.html">XtendSAN</a> </div> What is... style="border: 2px; #FFFFFF" class="section"? Is it a div style? if so, what is "section"? "section" should be a style that has "style" attributes INCLUDING "border" style info (border: 2px solid #fff;) This is just plain sloppy - where are the semi-colins? what is a "10"?: <style type="text/css"> <!-- .style1 {font-size: 12px} .style3 {font-size: 10px} .style4 {font-size: 10} .style5 {color: #FF0000} .style6 {font-weight: bold} --> </style> The code is so bad that even the w3c html validator blew up! [a href=\"http://validator.w3.org/check?verbose=1&uri=http%3A//www.attotech.com/index.html\" target=\"_blank\"]http://validator.w3.org/check?verbose=1&ur....com/index.html[/a] Your css is scary! Absolutely NO browser other than IE can understand this. IE will take any "junk" code and display it as valid. But ANY Standards compliant browser will smack you in the back of the head for using code like this. Your whole site needs to be fixed to comply with either html 4.0 or xhtml (whichever you finally settle on). Your css needs to be completely revised ... I have no idea where this came from, but you have a few style sheets that seem to have the same tag level function (which means only the one that is last in your order will work (the "cascade" in css). Do you really know what each css item is for? Tag selectors: yours (note missing semi-colin)- A { TEXT-DECORATION: none } BODY { FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #FFFFFF;} correct: body { font-size: 12px; color: #000000; font-family: Arial, Helvetica, sans-serif; background-color: #FFFFFFA; } a { text-decoration: none;} ***************************** But! Here is the "good news". If you change your doctype to html 4.0: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> You have under 30 validation error. that are easily fixed. I applaud anyone who trys to get there code working outside of IE, and it's intentionally counter-web standards BS. It takes time to be "de-programmed" like anyone removed from an evil cult does ... but it is well worth it. Becaue you will suddenly notice better goodle placement for natural search results as well as at least a 20% increase in activity (those who would rather stick needles in their eyes than use IE). The best tool to help fix your website is the w3c html validator at: [a href=\"http://validator.w3.org/\" target=\"_blank\"]http://validator.w3.org/[/a] Once the html is valid, go and validate your css at [a href=\"http://jigsaw.w3.org/css-validator/\" target=\"_blank\"]http://jigsaw.w3.org/css-validator/[/a] Good luck! Dave
  7. [!--quoteo(post=339511:date=Jan 24 2006, 02:18 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jan 24 2006, 02:18 PM) [snapback]339511[/snapback][/div][div class=\'quotemain\'][!--quotec--] No idea -- that makes no sense at all. [/quote] LOL!!!! That's what we've been saying! Okay, it has to be related to the fact that I am using w3c standard. That's really the only difference between FF and IE that could cause this. THEREFORE, it MUST be something in the way we are instructing the php to INSERT and auto increment. Okay. I just created a record and it worked fine. THEN I added the above html back to the table and WHAMMO! Duplicate blank entry!!!! I'm sorry, this is really really weird! Here is the auto-increment command and the first of the insert commands (7 tables - 7 query inserts): //get next available id number $maxquery = "select * from setups order by id asc"; $max_result=mysql_query("$maxquery") or die(mysql_error()); while($result_row=mysql_fetch_array($max_result)) { $id = $result_row[id]; } $id++; //store data into setup table $query = "insert into setups (id, address, city, state, location, block, lot, bldg_size, land_area, zoning, stories, description2, sale_price, contact, title, exclusive, show_address, form_type) values ('$id', '$address', '$city', '$state', '$location', '$block', '$lot', '$bldg_size', '$land_area', '$zoning', '$stories', '$description2', '$sale_price', '$contact', '$title', '$exclusive', '$show', '$form_type')"; $result=mysql_query("$query") or die(mysql_error()); //store data into photo table $photo_query = "insert into photo....(I used same format as above for all of the queries)" //store data into expense table $expense_query = "insert into expense... //store data into cost table $cost_query = "insert into cost ... //store data into income table $income_query = "insert into income ... //store data into date table $date_query = "insert into date ... //store data into rent table $rent_query = "insert into rent... mysql_close(); ?> Now. Someone tell me how would any subsequent html tag could add a row to the tables? Dave
  8. I have a php form that sets an ID auto increment insert whenever a new row (record) is added by form. It works fine when submitted via IE. But, when submitted via FF it adds a blank row to the DB table (along with the correct row) and auto increments them both (ex: id 07 & id 08)! We scoured the code and could find no reason for it to do this. Then, I noticed, and removed, 2 small unecessary (and improperly used) image placeholders in two <td> tags: <tr> <td><img name="placeholder" src="" width="32" height="1" alt="placeholder"></td> <td width="220"><img src="" width="220" height="1" alt="" style="background-color: #FFFFFF" /></td> When removed, it properly inserted one incremented row. How could a static html tag (no matter how poorly entered) dynamically add an insert to a table? For the static tags, I use validated w3c standard xhtml transitional (which the TD tags obviously didn't conform to). I don't get it.
  9. [!--quoteo(post=330045:date=Dec 23 2005, 04:54 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Dec 23 2005, 04:54 PM) 330045[/snapback][/div][div class=\'quotemain\'][!--quotec--] The inconvenience of having to have similar login credentials to both DBs precludes to use of this technique for any DB that you haven't explicitly set up in this fashion. If it's up to you, keep the related tables in the same DB; if it's not, consider doing this in middleware or via temporary tables, otherwise you'll get caught with your pants down in the credentials ever change! I suppose the other important issue is making sure there is a common relational key (ID) between the 2 DB tables.
  10. [!--quoteo(post=330058:date=Dec 23 2005, 05:21 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Dec 23 2005, 05:21 PM) 330058[/snapback][/div][div class=\'quotemain\'][!--quotec--] First, even with a standard upload form, you should be able to automatically change the name of the uploaded file to whatever you want -- including the listing ID -- so I don't understand why this is a problem. Second, storing binary data in BLOBs is OK, as long as a) you store the BLOBs in their own table with a foreign key referencing the listings and b) you don't store the entire binary data object in a single BLOB field. Take a look at [a href=\"http://php.dreamwerx.net/forums/viewtopic.php?t=6\" target=\"_blank\"]this excellent tutorial[/a] -- it covers all of the scripting, and addresses my two caveats above as well. Hope that helps. Thanks. I decided to do the smart thing and simply have the photo upload as a pop-up ( after the form submit is clicked) that loads them to a folder, renames them (12345a, b, c, d, etc) which auto associates them with the listing ID. I'll have the form include a hidden link to the photos file using the listing ID (12345a,b, c, d) pointing to the folder where photos are stored. I appreciate the reply. Dave
  11. I am creating a form that among various and typical fields, there is a photo upload. My user is a specialized real estate agent, so I need to attempt using as few steps as possible for them to enter the listing data. Usually, I edit, name and upload photos to a folder and have a link in the db (the photo naming conventions I use are the listing ID# (234567a, 234567b, etc.). But in this case, I simply want to automate the process as much as possible. This bozo is not going to rename the photos, so creating two forms will not help the photo associate with the listing ID. I was thinking of simply uploading the photo and inserting it into the DB along with the other fields. Can, and if so, how, would one upload binary media like photos, mp3s, etc.? I tried making the field, blog-binary, and it did upload, but I haven't tried to display it, yet. Of course, doing a query in phpmyadmin just shows the actual binary code.
  12. I can't see how you are streaming an audio file of any kind. Is it mp3? WMA? The easiest way is to generate an .m3u file that points to and streams an mp3. What media are you trying to play?
  • 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.