Jump to content

fireslug

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fireslug's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Gareth, I have no idea of what part of the code has the problem, but here's what i think is the area where the code resides. <form action="relist.php" method="POST"> <table border="0" cellpadding="0" width="100%" cellspacing="0" height="221" style="border-collapse: collapse; border: 1px solid #3366FF" bordercolor="#111111" bgcolor="#ffffff"> <tr> <td width="100%" bgcolor="#6666FF" height="32"> <p align="center"><b><font face="Verdana" size="3" color="#FFFFFF">Your Recent Specials <?=titleCase($uid)?> - <?=titleCase($sbrb)?> </font></b></td> </tr> <tr> <td width="100%" height="35" valign="middle" bgcolor="#FFFFFF" align="center"><input type="submit" value="Re-List Item" style="background-color: #FFFFFF; border-style: solid; border-width: 1"> </td> </tr> <!--Start Print data--> <? $dt= date('Y-m-d'); $sql="select * from post_special where userid='$uid' and status='s'"; //echo $sql; $i=1; $res_1= mysql_query($sql) or die('$sql<br>Error---->'.mysql_error()); While ($row_2=mysql_fetch_array($res_1)) { $uid=$row_2['userid']; ?> <tr> <td width="100%" height="21" bgcolor="#E1E1FF"> <Table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff"> <tr> <td width="37%" bgcolor="#E1E1FF"> </td> <td width="5%" bgcolor="#E1E1FF"> </td> <td width="33%" bgcolor="#E1E1FF" class="suburb1"> </td> <td width="25%" bgcolor="#E1E1FF" class="suburb1"> </td> </tr> </table> </td> </tr> <tr> <td width="100%" height="21"> <table border="0" cellpadding="0" width="100%" cellspacing="0" bgcolor="#ffffff"> <tr> <td width="2%" valign="top" style="border-right: 1 solid #FFFFFF" align="center"> </td> <td width="100%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="0" height="85" bgcolor="#ffffff"> <tr> <td width="12%" rowspan="3" valign="top" class="suburb1"><table width="85" height="63" border="0" bgcolor="#ffffff"> <tr> <td width="79" scope="col"><a href="uploadimage.php?id=<?=$row_2[0]?>" class="suburb1"> <?php $smallImage = "No_image.jpg"; $filename = ""; if($row_2['smallImage']!="") { $filename = "pics/photo/"."t_".$row_2['smallImage']; if(file_exists($filename)) $smallImage = "t_".$row_2['smallImage']; } ?> <img border="0" src="pics/photo/<?=$smallImage?>" width="75" height="75" align="center"></a></td> </tr> </table></td> <td width="88%" height="23" class="suburb1"><input type="checkbox" name="n<?=$i?>" value="<?=$row_2['id']?>"> <? echo titleCase($row_2['product']);?></td> </tr> <? $i=$i+1; $date1 = explode('-',$row_2['sdate']); $dd= $date1['2']; $mm= $date1['1']; $yy= $date1['0']; $date1 =$mm."/".$dd."/".$yy; $dt=date('D, d M Y',strtotime($date1)); $date1 = explode('-',$row_2['edate']); $dd= $date1['2']; $mm= $date1['1']; $yy= $date1['0']; $date1 =$mm."/".$dd."/".$yy; $dt1=date('D, d M Y',strtotime($date1)); ?> <tr> <td height="3" class="content2">Start Date: <?=$dt?> - End Date: <?=$dt1?></td> </tr> <tr> <td height="18"><span class="suburb1">Normal Price : <? echo "$".$row_2['nprice'];?> Special Price : <? echo "$".$row_2['sprice'];?></span></td> </tr> <tr> <td height="26" colspan="2" class="content2">*Click on image for change or delete </td> </tr> </table> </td> </tr> </table> <? } ?></td> </tr> </table> If you can help or offer some advise, I will be most appreciative. Cheers Ric
  2. I would really appreciate help from anyone who can tell me how to permit a user to enter an end date, and have it accepted by the system. Currently a customer can enter a start date, but if they enter an end date that is in the same month as the start date, the system reports "select an end date greater than current date", which is ridiculous considering that any date after the start date is greater than the start date. I look forward to any help I can get. Ric
  3. I thought that might be the case. The categories and sub cats, will be the same in both country's tables. But I gather that adding say, UK suburbs, will mean adding that country's burbs, AND adding all the categories? Ric
  4. That's one helluva question. I would not have the faintest idea. I am totally new at this, and had my database created by a coder (who has long gone), so I have been toodling around trying to learn mysql and php. Not doing very well, but am keen to learn. Thanks for your rapid reply. Ric
  5. My hoster is running MYSQL 4.0.24_Debian-10sarge2 and phpMyAdmin 2.6.4-pl3. I have a table for New Zealand that contains all of the country's suburbs, named "suburb_master. I want to add another country and all suburbs from that country. Will i need to create another table using that country's name or use the existing table? If so, how to add the new suburbs. The categories used in the country table, will be exactly the same. Only the suburbs will be different. I would appreciate any help and advise anyone can spare. Cheers Ric chan
  6. Thanks Thorpe for your note. Oh well, I guess I need to look at it in a different manner. Is there a way for me to obtain a script that will allow me to extract and display details from say, tables such as: suppliers categories specials etc If I can get one sample, I think I might be able to work out out to extract data from the others and display them (most probably wishful thinking). cheers Ric
  7. I am trying to develop a DB drivin site and have received help from a local guy (Robert), but he has since got too busy to help. The site is being hosted by friend (Steve) who is also too damned busy to assist in developing the site, so I'm thinking maybe I should try to do it myself, with a bit of outside help. If anyone is interested and has the time, I would really really appreciate the input. Rob created index, login, register etc, pages that were working, until the server was reset and the database was lost. Nysql and phpmyadmin are installed on the server, I think I can create the necessary tables, but I have no idea of how to access the information stored in those tables. I would like to know where in the included index.php code, is the information that allows me to connect to the database. I noticed that there is no mention of: $dbhost = ""; //Your database host $dbname = ""; //Your database name $dbpass = ""; //Your database password  etc in the index page created by Rob, and would like to know how did he access the database with the aforementioned lines? Based on the search queries, what tables do I need to create? Here is the page created by Robert: <?php   require 'mysite.php';   set_error_handler("errHandler");         $db = connectdb();     // Category list - template includes link to select each category   $categories = categorylist( "<ul>", "</ul>",                               "<li><a href=\"" . $_SERVER['PHP_SELF'] . "?category=%catid%\">%cattitle%</a></li>",                               isset($_GET['category']) ? $_GET['category'] : null, $db );   // Only the newest X specials, with pictures, are shown as featured specials. The rest are just listed. See configuration for value of X.   $supplierlinks = "";   $speciallinks = "";                   // Specials are shown by...   if ( isset($_GET['category']) ) {         // ... category selected from the list     $selectedspecials = "Latest top specials in <strong>" . getcategorytitle($_GET['category'],$db) . "</strong>";     $specials = specialsbycategory( $specialmarkup['general'], $_GET['category'], "", $db );     $supplierlinks = supplierlistonly($listmarkup['supplier'],$notfoundmarkup,$db,$_GET['category']);     $speciallinks = speciallistonly($listmarkup['special'],"",$db,$_GET['category']);       } elseif ( isset($_GET['search']) ) {         // ... a text search     $selectedspecials = "Specials matching search for '<em>" . $_GET['search'] . "</em>'";     $specials = specialsbysearch( $specialmarkup['general'], $_GET['search'], "", $db );     $supplierlinks = specialsbysearch($listmarkup['supplier'],$_GET['search'],$notfoundmarkup,$db,true,true);     $speciallinks = specialsbysearch($listmarkup['special'],$_GET['search'],"",$db,true);       } elseif ( isset($_GET['supplier']) ) {         // ... link to a specific supplier     $selectedspecials = "Current specials at <em>" . getsuppliername($_GET['supplier'],$db) . "</em>";     $specials = getsupplierinfo($_GET['supplier'],$db) . specialsbysupplier( $specialmarkup['supplier'], $_GET['supplier'], $notfoundmarkup, $db );       } elseif ( isset($_GET['special']) ) {       // ... link to a single/specific special     $specials = specialsbyspecial( $specialmarkup['special'], $_GET['special'], "Sorry, the special you selected has just expired!", $db );     $catlist = specialcategories( ",%title%", $_GET['special'], "", $db );     $specials = $specials . "<p>Categories: " . substr($catlist,1,strlen($catlist)-1) . "</p>";     $selectedspecials = "";     } else {         // ... by default, the latest (i.e. furthest from expiry) specials     $selectedspecials = "The latest top specials on mysite.co.nz";     $specials = specialsbylatest( $specialmarkup['general'], "", $db );     $supplierlinks = supplierlistonly($listmarkup['supplier'],$notfoundmarkup,$db);     $speciallinks = speciallistonly($listmarkup['special'],"",$db);       }     // Add headings and list tags for supplier and special lists   if ( strlen($supplierlinks) > 0 ) {     $supplierlinks = "<p class=\"header\">Suppliers</p><ul>" . $supplierlinks . "</ul>";     $speciallinks = "<p class=\"header\">Specials</p><ul>" . $speciallinks . "</ul>";   }     mysql_close($db);   restore_error_handler(); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html>   <head>     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />     <meta name="description" content="mysite contains the latest specials." />     <meta name="author" content="Charles Jamieson" />     <title>mysite.co.nz</title>     <link rel="stylesheet" type="text/css" href="mysite.css" />   </head>   <body>     <div class="header">       <h1>mysite.co.nz</h1>     </div>         <div class="search">       <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">         <p>Search: <input type="text" name="search" value="<?php echo isset($_GET['search']) ? $_GET['search'] : ""; ?>" />         <input type="submit" value="Go" />       </form>     </div>         <hr class="pageanchor" />         <div class="maincontent">       <div class="speciallist">     <p class="selectedspecials"><?php echo $selectedspecials; ?></p>       <?php echo $specials; ?>     </div>         <hr class="pageanchor" />         <div class="supplierlinks">       <?php echo $supplierlinks; ?>     </div>     <div class="speciallinks">       <?php echo $speciallinks; ?>     </div>     </div>         <div class="categorymenu">       <h4>Browse</h4>       <?php echo $categories; ?>               <p class="link"><a href="supplier.php"><font face="Arial, Helvetica, sans-serif" size="2">Supplier     login</font></a></p>   <p class="link"><font face="Arial, Helvetica, sans-serif" size="2"><a href="register.php">New     supplier registration</a></font></p>   <p class="link"><font face="Arial, Helvetica, sans-serif" size="2"><a href="about.html">About     mysite</a></font></p>     </div>         <hr class="pageanchor" />     <p class="legal"><font size="2" face="Arial, Helvetica, sans-serif">All prices   $NZ including GST, subject to change without notice.<br />   Supplier names, logos, products and images copyright of their respective owners.<br />   Site design &copy; mysite.co.nz, 2006.</font></p>   </body> </html> ------------------------------------------------------------------------------------------------ To recap: what tables need to be created. how to access the info in those tables I'm totally new to php and coding, and have no idea how to proceed from here. I hope someone can spare me a little time and help. Ric
  8. I'm brand new and totaly green to php/mysql and need a little bit of help to get started. If anyone out there is patient and condierate enough to help, I would be eternally grateful I have at last managed to install Xxamp which allows me to play with mysql and php before uploading to the server. I have created tables in mysql but have no idea of how to access the new DB or indeed, add data to it. Several DB were included with xxamp. I thought that I could make a few changes to one of the existing php pages so I could access the new DB that I created, but I simply can't get it to work I can add and change data on the server, but can't do it on my PC. I have screenshot the folder and subfolders to send to anyone who can help by looking at the structure and advising the code to enter into the pgp page. Ric
×
×
  • 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.