Jump to content

bach

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by bach

  1. Thanks, I have changed this and added a further table. Been thinking of the dbconnect, would you want to use one method for query checking members exist and another one to add information for security etc ?
  2. Liquid, Thanks for the reply again, There is no specific reason for the data type of int for the amended date I saw this on another system and I was not sure which one was correct. Do you know the difference between them. Cheers.
  3. Liquid Fire, Thank you for replying, I have amended the fields to reflect your comments.
  4. Hi, I have been thinking of writing an web application for a member based system. I have come up with an initial DB design and would like some feedback advise next step's etc as this is the first time I am doing this. Concept To hold information about its members and what roles they do, it needs to be simple, fast and functional. There are many aspects of this system for future development for building information, availability information etc so this needs to be thought about in the initial stages so a re-design will not be necessary. Thanks.
  5. bach

    ConCat help

    yes if I display s_phone I get the data but not in the format, so my queryis how do I get the format out of the query ??
  6. bach

    ConCat help

    I have the following SELECT statement [code]SELECT s_name, s_firstname, CONCAT_WS('-', LEFT(s_phone, 4), MID(s_phone, 5, 3), RIGHT(s_phone, 4)) FROM `bridgend`.`sam` ORDER BY s_name asc;[/code] When displaying s_phone nothing is displayed on the my site.  s_name and s_firstname is displayed would I somehow have to put concat_ws in a temp variable so I can display it on my site. Regards
  7. Craygo, Thanks for your help. The only thing that did not work is the s_phone, I would like to display the newly formated data I am missing something here. Just to make sure I understand the code. [code]$result = mysql_query($phonelist) or die("Error: ".mysql_error()."<br />"); $num_rows = mysql_num_rows($result);[/code] $result is the query on the database using the select statement and returns an error if there is a problem $num_rows just counts number of rows returned by query ?? [code]while ($row = mysql_fetch_array($result)){[/code] as long as $row has data in it will stay in the while loop ?
  8. Thanks for your help, I have enabled the code as above. It is now complaining of line 33 [code] while ($row = mysql_fetch_array($phonelist)){[/code] any idears.
  9. Hello, I have the following MySQL statement [code]SELECT s_name, s_firstname, CONCAT_WS('-', LEFT(s_phone, 4), MID(s_phone, 5, 3), RIGHT(s_phone, 4)) FROM `bridgend`.`sam` ORDER BY s_name asc;[/code] I want to display the details of this in a table and loop round until the all records are displayed. This is what I have so far but there problems would be greatful for some help. [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-gb"> <head>   <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> </head> <body> <?php include("condb.php"); $phonelist = "SELECT s_name, s_firstname, CONCAT_WS('-', LEFT(s_phone, 4), MID(s_phone, 5, 3), RIGHT(s_phone, 4)) FROM `bridgend`.`sam` ORDER BY s_name asc;"; $result = mysql_query($phonelist); if (!$result) { Print("Error: ".mysql_error()."<br />"); die(); } ?> <h1>Title</h1> <h2>Phone</h2> <table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="2">   <tbody>     <tr>       <td>Nick</td>       <td>Ask for</td>       <td>Contact Number</td>     </tr> <?php    if ($row = mysql_fetch_array($phonelist)) { while ($row = mysql_fetch_array($phonelist)) { ?>     <tr>       <td><?php print $row["s_name"]; ?></td>       <td><?php print $row["s_firstname"]; ?></td>       <td><?php print $row["s_phone"]; ?></td>     </tr> <?php     } //End While } //End if ?>   </tbody> </table> </body> </html>[/code] I am not sure if this will fully work with printing s_phone when I am using concat in the query but the problem at present seems to be with [code]if ($row = mysql_fetch_array($phonelist))[/code]
  10. Hello, The following code is an example of the menu code contained on all the fundraising pages. [code] <ul> <li><a href="../index.xhtml">Home</a></li> <li><a href="../about/about.xhtml">About</a></li> <li>Join Us</li> <li>Outreach</li> <li>News &amp; Events</li> <li><a href="fund.xhtml">Fundraising</a></li> <ul> <li><a href="campaigns.xhtml">Current Campaigns</a></li> <li>Help Us Raise Funds</li> <li>Donations</li> </ul> <li>Contact Us</li></ul>[/code] My question is that on each page with a sub-menu like Fundraising I need to change the menu/sub-menu. Is it possible for me to write the whole menu and sub-menus and use php to check which submenus should be shown? Bach
  11. bach

    To a FILE

    Thanks for yor reply, How would I go about writing the log to the file?
  12. bach

    To a FILE

    Hello, I would like to create a function/class (not sure which one appropriate) to log errors to a file. To start with I would like to create a 'errorlog.txt' file where every mysql error message will be writen so I would be able to check the error log to see if anyone has been having issues login into database, etc. Now I have the mysql error being displayed as part of my connection but I do not want the user to see this message. So I would need to store that into a file instead I have no idea on this anyone able to help ? Bach.
  13. [!--quoteo(post=375747:date=May 21 2006, 01:06 PM:name=annihilate)--][div class=\'quotetop\']QUOTE(annihilate @ May 21 2006, 01:06 PM) [snapback]375747[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try getting rid of the $ infront of mysql_select_db [/quote] Thanks for your reply, I can't believe i missed it cheers
  14. Can you help I have got an if statement which is got an error Error Fatal error: Call to undefined function: () in sam/db.php on line 22 [code] if(!$connection = mysql_pconnect($host, $username, $password)) {   $message = mysql_error();   echo $message."<br />";   die(); } line 22 - elseif (!$mysql_select_db($database, $connection)) {   $message = mysql_error();   echo $message."<br />";   die(); }[/code]
  15. bach

    Data type Query

    I was under the sam impression, if there isn't a good reason then I will use a date field for mine. The forum software was [a href=\"http://www.simplemachines.org/\" target=\"_blank\"]Simple Machine Forum[/a] Cheers.
  16. Hello, Wonder if you can help. I am looking at the data type of the dateRegistered field for a form script I have got they are using int(10) why ?? why not date ?? Confusing me. Cheers.
×
×
  • 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.