Jump to content

rscott7706

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by rscott7706

  1. cags and Evilace Thanks for your input, I worked on it late last night and got it going due to your great input. cags, in the future, I will use PHP tags - my bad. Ron
  2. Thanks for all your quick response. I have to go out right now, but will work this a little alter today or tonight. Again a big THANK YOU!! I will let you know how it goes. Ron
  3. I still get an error. I am not now sure if the query is proper although it works fine without the join table request. Parse error: syntax error, unexpected T_STRING in /home6/crtsdorg/public_html/volunteer form/apForm1_List3.php on line 12 Line 12 is: echo "ID: "; But, if I take the title out, and leave just: echo $row['id']; echo $row['date_created']; } I still get an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home6/crtsdorg/public_html/volunteer form/apForm1_List3.php on line 12 I don't don't know, PHP just kicks my tail - I just don't seem to get it. Why would a query work fine on one Select statement, but not another... Ron
  4. For some reason, the following query works fine (QUERY 1), but the one further down (QUERY 2) that attempts to join tables does not. It would solve a lot of problems for me if I can get the "join tables" concept down pat. I left out username and password from code. Here is a link to QUERY 1 that works (does not join tables): https://communityrecoveryteam.org/volunteer%20form/apForm1_List.php Here is a link to QUERY 2 that does not work (seeks to join tables): https://communityrecoveryteam.org/volunteer%20form/apForm1_List2.php QUERY 1 <?php echo "<font face=\"verdana\">"; echo "<br />"; $db = mysql_connect("localhost", "", ""); mysql_select_db(""); $query = "SELECT * FROM ap_form_1 ORDER BY id desc"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<br />ID: "; echo $row['id']; echo " Date Volunteered: "; echo $row['date_created']; } ?> QUERY 2 <?php echo "<font face=\"verdana\">"; echo "<br />"; $db = mysql_connect("localhost", "", ""); mysql_select_db(""); $query = "SELECT id, date_created FROM ap_form_1, ap_element_options WHERE ap_form_1.id = ap_element_options.form_id ORDER BY date_created DESC; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<br />ID: "; echo $row['id']; echo " Date Volunteered: "; echo $row['date_created']; } ?> Thanks! Ron
  5. Jnerocorp Thanks for the quick response. This is exactly what I want, but it looks like JavaScript - I would like to avoid. I am not familiar with ajax at all. I would like to do it with pure php if possible. Am I off track here? Ron
  6. I want to set up a template that has a header on top, footer on bottom, content area in middle of screen and a menu on left side of screen. I want the menu links to call underlying pages written in html to display in the 'content" area. Much like Iframes, but with the clean coding of php include. Is this possible? Ron
  7. Thank you - everyone for your help. Why I don't know, but I switched stye sheets, now it is linking ok. Just have to customize this one and will be good to go. Thanks Again. Ron Scott
  8. OK, it is not as I am not trying to do myself, i know it may seem that way. I have been on it for hours. My dilema is that the table tag will take certain attributes, not others: echo '<table width="350" font size="3" color="red">'; Table width works great, but not font or size. another: <td valign='top' width='65%' color='E4CAB' font-size='10pt'> Again valign works fine, width works fine, but not font or color. I know I am not an expert and honestly I understand if you think I need to learn more on my own!! Thanks anyway. Ron Scott
  9. Thanks GingerRobot, How about putting the font & or font size tags in there? Sorry to be a bother. Ron Scott
  10. GingerRobot, thanks for your quick reply... '<table id="board">'; The table call is in an echo call. echo "</table>"; If I use the html call id="board", it crashes the PHP code and I get a php error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/lakesie7/public_html/iframe_files/board-13.php on line 80 I tried that and various id=/"board/", etc...
  11. Hello all... I just feel like I should be getting this, but I still struggle. I searched using many search terms but cannot find the answer. I want to place font and fonts size info in this tag: echo "<table>"; or.... Put the id "board" in the tag so I can reference my CSS sheet. Either one would be fine - with CSS best. Here is my total code (sans connection info): <?php echo "<table>"; $query = mysql_query("SELECT `title`, `fname`,`lname` FROM board ORDER by 'sort'"); while(list($title, $fname, $lname)=mysql_fetch_row($query)){ echo " <tr> <td valign='top' width='35%'>$fname $lname </td><td valign='top' width='65%'>$title</td></tr>"; } echo "</table>"; ?> Thanks, hope someone can help! Ron Scott
  12. widox, Works perfectly - thank you so much. I appreciate your time and effort!! Ron Scott
  13. Thanks my friend - I will run with it. This gets me started and I should be able to bull dog it from here. I will let you know how it goes tonight. Thanks!! Ron Scott
  14. The links are all absolute - they have to be for the externals for sure. But for consistency, I did the internals as absolute also. examples: external: http://www.jcfeedandsupply.com/events.htm internal: http://www.lakesideca.com/lakeside/events/revitilaztion.htm I don't understand your reference to "Then you just alter the link HTML accordingly." Everything I am doing here is through the database and PHP coding - no HTML (to that degree). Pardon me for not getting that part... Thanks again... ??? Ron Scott
  15. widox - Thanks for your quick response. The link comes from the database named "link". In the coding I just made it automatically go to _blank, but soon realized I want the base links (my site links) to go to an Iframe called "container", but external links to go to _blank. I could have the link in link field in the database determine the target, but inexperienced Chamber office works will be putting the link info in the database, so I wanted to keep it simple for them. Here is more code, leaving out log on info: mysql_select_db("lakesie7_articles"); $query = "SELECT * FROM coming_events ORDER by sort"; $result = mysql_query($query) or die(mysql_error()); echo "<font face=\"arial\">"; while($row = mysql_fetch_array($result)){ echo "<font color= maroon><font size=2><b>"; echo $row['event']; echo "</b></font>"; echo "<font color= black><font size=2>"; echo $row['article']; echo "</font>"; echo "<a target=\"_blank\" href='$row[link]'> Go there</a>"; echo "</font>"; echo "<br />"; echo "<br />"; } ?> Thanks again... Ron
  16. Hey all, I have a unique problem. Here is a snippet from my code: echo "<a target=\"_blank\" href='$row[link]'> Go there</a>"; Now, I need to have some links to target an Iframe named "container", but others to target _blank. In other words, I have some links that are targeted to my site only, but some to friends of the Chamber that must open in a new window. I know I could build in to my database, a field that would allow target=container or target=_blank, but how do i get my PHP to recognize this, and plop it in after the opening tag <a and before the href= part? Egads.... Thanks in advance... Ron Scott
  17. OK, would link_variable in printf('<a href="%s">Go to this link</a>',$link_variable); just be "link" referring to the field link in the database? Or am I confused on it's intention? Ron
  18. Pardon me if this has been answered, I searched on several key words and did not find an answer. I am setting up a database that a non-profit can post their own news articles. Here is the structure: Type Collation id int(3) event varchar(255) link varchar(255) date_added timestamp delete_date date I want to have the "link" field contain the page link (ie http:/www.somewhere.com) the user will be directed to. But, I would like a generic title to appear (instead of the address itself) - like "Go to this Link". In other words, the PHP coding would make the words "Go to this Link" appear on the web page, but link to the link contained in the database link field. I hope I explained that well, and someone can help. Thanks in advance!! Ron
  19. DarkWater, menriquez and abdbuet, Thanks for your quick responses. menriquez - I left out log on info intentionally. abdbuet - your solution worked fine, thank you all so much!!! Ron Scott
  20. Hello all, I have a problem with a table snippet. I have a page that works fine using the following code: <?php $db = mysql_connect("masterli.ipowermysql.com", "", ""); mysql_select_db("masterli_rates"); $query = "SELECT * FROM costs"; $result = mysql_query($query) or die(mysql_error()); ?> <?php echo "<font face=\"times new roman\">", "<size=\"1\">"; echo "<table>"; $query = mysql_query("SELECT Item, Price, Postage, Notes FROM costs"); while(list($Item, $Price, $Postage, $Notes)=mysql_fetch_row($query)){ echo " <tr> <td width=500, align: top, cell spacing: 3px>$Item</td> <td width=20, vertical-align: top, cell spacing: 3px align=right>$$Price</td> <td width=100, vertical-align: top, cell spacing: 3px>$Postage</td> <td width=400, vertical-align: top, cell spacing: 3px>$Notes</td> </tr>"; } echo "</table>"; ?> Here is the link: http://www.masterliens.com/prices-alone.php So, I copy this exact code to another site and re-address the necessary fields, now it won't work. And I get the following message: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/content/s/d/r/sdrental/html/automotive-page.php on line 92 Here is the code from the second site: <?php echo "<font face=\"verdana\">"; echo "<br />"; $db = mysql_connect("p50mysql99.secureserver.net", "", ""); mysql_select_db("tools_equip"); $query = "SELECT * FROM inventory"; $result = mysql_query($query) or die(mysql_error()); ?> <?php echo "<font face=\"arial\">", "<size=\"1\">"; echo "<table>"; $query = mysql_query("SELECT Desc, Model, Pic FROM inventory"); while(list($Desc, $Model, $Pic)=mysql_fetch_row($query)){ echo " <tr> <td width=50, align: top, cell spacing: 3px>$Desc</td></tr> <td width=200, vertical-align: top, cell spacing: 3px align=left>$Model</td> <td width=50, vertical-align: top, cell spacing: 3px>$Pic</td></tr> </tr>"; } echo "</table>"; ?> The first site is hosted by IpowerWeb, and is using: PHP Version 4.4.7 The second site is hosted by GoDaddy and is using: PHP Version 4.3.11 Any ideas? ???
  21. Never mind.... Got it. Here is the code in case anyone ever needs it: echo '<a href="'.$row['link'].'">'.$row['Class'].'</a><br>'."\n"; Sorry to bother everyone.
  22. I have racked my limited brain, and searched endlessly on the subject. To now, haven't been able to figure out what s/b a simple one. I have a table with two fields - Class and link. Class is populated with things like Automobile, Construct Equip, etc. link is populated with the links I want users to go to when the click on Class. In searching I thought I found the solution, as shown here: echo "<a href='$row[link]'>".$row[Class]."</a>"; But alas it gives me an error: Parse error: parse error, unexpected T_CLASS, expecting ']' in /home/content/s/d/r/sdrental/html/rentals-class-only4.php on line 118 Am I way off base here? Can anyone help? Thanks in advance!!
  23. To Foser, "If you tell us more about the web server, and then I could maybe tell you ways to catch it with php then put into mysql queries." Here you go, SERVER INFORMATION: operating system FreeBSD 4.11-STABLE mysql version mysql Ver 12.22 Distrib 4.0.27 perl version perl, v5.8.3 php version PHP 4.4.1 ================================ To axiom82: I apologize, but don't understand your suggestion. In my feeble mind, it would be better to upload the entire file (they are fairly small, 400k now). Am I misunderstanding your suggestion? I would think the cleanest, most simple way would be: 1. through my own work, I would assure there is a MySql file sitting on their internal server ready to go each night 2. We would have a PHP routine (again on their server) that fires and uploads the MySql file to the Web server at a certain time in the early morning hours (2 or 3 am). Am I looking at this wrong?
  24. Just want to bump this in case someone may help. 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.