Jump to content

glennn.php

Newly Registered
  • Posts

    251
  • Joined

  • Last visited

Everything posted by glennn.php

  1. the thing is, there are 280+ RECORDS, with 75+ options_X, with 176 options_values... SOME which will be empty, so i did the iteration to skip the empty ones...
  2. agreed, i'm sure i've made it more complicated than needed - my client supplied me with spreadsheets of these options ... let me try to draw up a little schema: FIELDS | option_1 | option_2 | option_3 | VALUES | option_19015 | option_19001 | option_19065 | VALUES | option_19022 | | option_19043 |
  3. ok, i'm having trouble wrapping my mind around this little hurdle: having this: $option_1 = $row['option_1']; $option_2 = $row['option_2']; [...] $option_78 = $row['option_78']; where ANY of $option_x would contain: switch ($options) { case "option_19000" : $option = "aaa"; break; case "option_19001" : $option = "bbb"; break; [...] case "[b]option_19176[/b]" : $option = "176xxx"; break; } and i have this, which gets me what i want from the database: for ($i=1;$i<76;++$i) { if (${'option_'.$i} != '') $pagetext .= ${'option_'.$i} . "<br>\n"; } i can't figure out how to then apply my switch when $pagetext contains, say "option_19001"... i'd appreciate any help someone can offer. GN
  4. Fields Terminated by , Fields enclosed by 'EMPTY' (default is " - i left this field blank) Fields escaped by \ thanks for your help. GN
  5. i have fields such as this in a csv file: 6" X 4" Document Placard but when they're imported into my db, they end up as "6"" X 4"" Document Placard" i can't discover why this is happening not how to prevent it. anyone? i HAVE adjusted the "fields terminated by" and "fields enclosed by" fields in the import, with no change... help? thanks much
  6. i don't know if this can be done with a switch() : switch ($val) { case "value1", case "value2", case "value3" : $par = "Value"; break; } but you see my intent. can someone tell me a way to use a switch to this effect? (instead of if (($val1 == '') || ($val2 == '') || ($val3 == '')) { $par = "Value"; } thanks for your help. GN
  7. i guess where i'm being 'dense' is that the content for a page generated by ...?pageid=42&product_name=SKB actually IS visible ...? i appreciate the pointers. i was just reading about duplicate content, etc. is GOOGLE going to own the world, or do they already...? :-) thanks
  8. Yes. Just be sure that each include's enough keywords. Like the URL mentioned by me would meet anyone that would search for: lead-generation boost lead-generation boost lead-generation seo terrific - (although i'm not sure how i'd "$_GET" pageid from "/42/" ... ?? and as far as content, what confuses me is whether a particular page generated from DB content when a link is clicked and that data is queried actually 'exists' or not - if that makes any sense... how can an SE see it if the page hasn't been physically generated...?
  9. so then " ../index.php?pageid=42&page=Cable-Pouches " is a 'friendly url' as regards an SE?
  10. i'm a php/mysql developer and NOT as SEO disciplined as i should be. i've developed a site for a client which is mainly driven by db data, and my urls largely consist of GET variables: index.php?pageid=42, etc... my client has done a LOT of SEO study for his site and now we're both concerned with what effect this is going to have on GOOGLE's (and others') indexing. i don't know who to ask or where to read on how to tackle this - if it needs tackling. as well, i'm curious as to how Search engines 'see' pages that are generated on the fly via database content. i can't believe that such pages are indexable, but as many websites are built in this fashion, i'm wondering how SEO is handled overall regarding site content AND URLs. i'm obliged if anyone can offer some pointers and/or a link to a good tutorial on the subjects. thanks GN
  11. i'm calling about 350 records from a table all at once and displaying the results in different areas of the page: $sql = "select id, makeid, model from models order by model asc"; $rs = mysql_query($sql); $acura = ""; $audi = ""; $bmw= ""; // and so on... while ($row = mysql_fetch_array($rs)) { $makeid = $row['makeid']; $checkbox = "<input type=\"checkbox\" name=\"model\" value=\"".$row['id']."\">".$row['model']." "; switch ($makeid) { case '1' : $acura .= $checkbox; break; case '3' : $audi .= $checkbox; break; case '4' : $bmw .= $checkbox; break; // and so on... } } echo $acura; echo "<br />"; echo $audi; echo "<br />"; echo $bmw; // and so on... this works, but i can't help but think there's a more efficient way to do this. anyone? thanks much. GN
  12. makes great sense. didn't even think that far ahead. that's what i'll do, thanks much, for all your help.
  13. this isn't working, but it looks like it should... doesn't carType have to be defined somewhere...?
  14. another question related to these divs, Acura1, Audi1, etc... within each div i have a short query calling the models of each of these makes, of course, which means i have ~45 queries in that page, all within hidden divs (initially). i'm certain that those queries are firing anyway, even tho the divs are hidden - is that the case, and is this a bad thing? i notice no slowness, but i surely like to know if what i'm doing is inefficient or not... thanks for you help. GN
  15. I just found that javascript - i'm a php junkie, not js ) this is where i got "Acura": <input type="checkbox" value="Acura" id="Acura" name="Acura" onclick="toggle_cars('Acura');"> and the div i'm hiding/showing is Acura1, yes. i'll try this and thank you in advance. G
  16. need a little help implementing a couple of php (or js) variables in this function: function toggle_acuras() { var form = document.getElementById('Acura'); var thanks = document.getElementById('Acura1'); ((form.checked)? Acura1.style.display='block': Acura1.style.display='none'); } where i can use function toggle_cars($variable) // toggle_cars($div_name) ?? // { var form = document.getElementById('$checkbox_name'); var thanks = document.getElementById('$div_name'); ((form.checked) ? $div_name.style.display='block' : $div_name.style.display='none'); } instead of writing 45 js functions... wouldn't this work somehow? the call is made in the checkbox input >> onclick="toggle_acuras();" thanks in advance GN
  17. i'm building a large db of Users who own more then one auto, for example. (LOTS more data, like various airlines they've used, etc. so there's more than one choice per user) i'm hoping someone might give me an idea how best to create INSERT and SELECT queries for Users who might own an Acura Legend and a Chevy Camaro. i have these tables: Makes with fields: ID, Make (contains many auto mfrs) Models with fields: ID, MakeID and Model (contains the respective models) Users ... what i can't get around is how to store data where Smith owns an Acura (1) Legend (5)(1) AND a Chevy Camaro - if someone helped me with a way to store this i could get the SELECT query myself. i considered storing an array in the user's row, i.e. user_makes (1,3) and user_models (5,12) and working with those arrays when i retrieve the data, but i'm really thinking there's a better way to do that. i hate arrays... i appreciate it much GN
  18. I'm doing a little stovetop experimentation (i know very little about AJAX) and i'm trying to get the latter function toggle_acuras() (toggled by a checkbox, obviously) merged with this AJAX getXMLHttp function. can someone help me with this? <script type="text/javascript"> function getXMLHttp() { var xmlHttp; try { xmlHttp = new XMLHttpRequest(); } catch(e) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX!"); return false; } } } return xmlHttp; } function refreshIt(divID, MyPage) { xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function(){ if(xmlHttp.readyState == 4) { setInnerText(divID, xmlHttp.responseText); } } xmlHttp.open("GET", MyPage, true); xmlHttp.overrideMimeType("text/html; charset=ISO-8859-1"); xmlHttp.send(null); return false; } function setInnerText(divID, response){ var el = (document.getElementById) ? document.getElementById(divID) : document.all[divID]; if(el) { el.innerHTML = response; } } /*******************************************/ function toggle_acuras() { var form = document.getElementById('Acura'); var thanks = document.getElementById('Acura1'); ((form.checked)? Acura1.style.display='block': Acura1.style.display='none'); } </script> thanks much!! or even someone could show me how to toggle a <?php include() ?> with a checkbox; which is all i'm trying to do with about 45 checkboxes... that'd even be better. thanks
  19. try SELECT DISTINCT * FROM...
  20. yeah, i didn't quite know how to word my question: the Search Form has options to search, say, Name and City - if someone searches for JUST a name and ANY City, the query "WHERE name = $name AND city = $city" won't work because the variable passed is empty if they don't choose a City. So "...WHERE name = 'Smith' AND city = ' '..." returns nothing since all the city fields are populated. hope that makes more sense. thanks GN
×
×
  • 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.