Jump to content

k4pil

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by k4pil

  1. Hi there ppl. I normally use jEdit for coding php. Its good but irs intended to be used for programming languages such as Java. Can any one recommend an editor for php which they have found particularly useful. Thanks in advance as always.
  2. hi ppl! Not sure if its in right the place, but here it goes I am trying to do some resarch on different types of databases, e.g. Spatial, temporal, relational etc. I want to compare the performance of these different types of databases when implementing different types of applications, e.g. CRM, financial data tracking etc. However, i have no idea where to start. Anyone with any suggestion Thanks in advance
  3. Hi there ppl. I have just tried to access my website and i get an error. Iv not viewed it for a few days. The error i am getting is; Warning: mysql_connect(): Too many connections in /home/kapi7150/public_html/connect.php on line 7 Unable to select database The file connect.php is included in the php script. Its as below; [code] <?php $username = "####"; $password = "####"; $database = "####"; mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); ?> [/code] Ive never had this problem before...so am totally stuck. No idea where to look. Any help???
  4. Sooo simple...but soo effective. Ive been trying triggers, emailing scripts...u name it..lol Thanks pps for showing me the light **SOLVED**
  5. Ok,...but i have no idea of how to do it that way either...where do i start??? Can you give me some help on what i need to do something like that ??
  6. have you tried to execute your query in your database. If it is working fine in there then you where to look next.
  7. Hi there ppl! I think this question maybe a lil complex. I want to create a trigger in my mySql database which sends an email upon an event. I have a table case(caseID, custID, priority, subject, description, type, created, solved ) When a new row is added which has priority = "high" i want the database to send an email to all the users from another table in the database; staff( userID, staff, access, username, password, name, surname, email ) where access = "3". Email address is also recorded in this table. I have no idea how to do this. Anyone?? Thanks in advance as always!
  8. OK. Here it goes. I have a table; products(prodID, prodName, prodDesc, supplier, costPound, costPence) where prodID is unique. These are some rows from that database (apologies in advance about the stupid names ;b ); 108 nokia 6680 nokia £99.99 6 nokia 3310 phone nokia £199.99 2 skyline car nissan £30000.0 3 skyline car nissan £45000.99 4 skyline car nissan £40000.99 1 tizer fizzy drink coke £0.35 When i run a query when $prodName is 'car' [code] $query = "SELECT * FROM product WHERE productID = '$ID' OR prodName = '$prodName' OR prodDesc = '$prodDesc' OR supplier = '$supplier' OR costPound = '$costPound' OR costPence = '$costPence'"; $result = mysql_query($query); $num = mysql_numrows($result); [/code] The output is! 1 tizer fizzy drink coke £0.35 2 skyline car nissan £30000.0 5 mars choclate mars £0.35 9 car fast car lkj £1.2 These extra values are output no matter what is searched for. The only explanation is that the query is returning all rows where $prodName = 'car' aswell as those rows which have an empty field - as these do in the costPence column. Hope this makes sense. Any help?
  9. Its actually an int. What i meant was ; $query = INSERT in table1 values '' '2' '0' That zero causes it to be output no matter what the searcg criteria. e.g. Select * from table1 where fig2 = "5" will still output the row above. When i delete the rows with 0 values everything else works fine.
  10. Hi there ppl. Quick question. I am adding data to my database. But when i search the database i am getting all fields that are being searched for as well as those that are empty. e.g. If i add to my database as follow; table (uniqueID, fig1, fig2) $query = INSERT in table1 values '' '2' '3.0' $query = INSERT in table1 values '' '4' '5' And then if i search; $query = SELECT * from table1 WHERE figure2 = '4' both rows are returned because there is an 0 in fig2 in row 1. Any idea wots goin on???? Is it something to do with stripping empty chars?
  11. The below is not working SELECT * FROM activity WHERE userID = 2 AND WHERE time BETWEEN 19700101020000 AND 20060606000000 Im am trying to get all rows where userID is 2 and time is between those two numbers. Any help? ive somehow solved it by rearranging - SELECT * FROM activity WHERE WHERE time BETWEEN 19700101020000 AND 20060606000000 AND userID = 2
  12. Hi there people. I have a table called activity in my database as follows; ID acID time page 1 2 20060307205835 CRM Home 2 2 20060307205838 View customer detail 3 2 20060407205847 Inventory Home Page 4 2 20060407205911 CRM Home 5 2 20060607205916 Inventory Home Page 6 2 20060607212811 View Cases Screen 7 2 20060707212834 Create Case Screen I want to query this databse from a certain time to a certain time. I have got the query working; SELECT * FROM `activity` WHERE time REGEXP '20060307*' it returns everything starting with that, ignoring the digits after (those represent time so can be ignored). I want to be able to search from a date e.g 20060307 to 20060707. Any one have any idea how i can do this??
  13. XenoPhage was totally right. I used timestamp which is a datatype provided be mySql and everything is soooo much easier. For the benefit of webezine il go over what i have. Firstly a table called activity which lists the activity of users; activity(activityID, userID, time, pageAccessed) [code] $query = "INSERT INTO activity VALUES ('', '$userID', NOW(), '$pageTitle')";     $result = mysql_query($query); [/code] When i created the table in mySql, the syntax was something like [code] CREATE TABLE `activity` ( `activityID` INT( 11 ) NOT NULL , `userID` INT( 11 ) NOT NULL , `time` TIMESTAMP NOT NULL , `page` VARCHAR( 20 ) NOT NULL , UNIQUE ( `activityID` ) ) TYPE = MYISAM; [/code]
  14. Hi there ppl! Just a quickie... I want to output from an array. I am currently doing the below; [code] $time=mysql_result($result2,$i,"time");         $page=mysql_result($result2,$i,"page");                  //get the time and convert the string into an array         $str = $time;         $arr1 = str_split($str);                  echo "<b>Time:</b>";         echo $arr1[7];//day         echo "$arr1[8]/";//day         echo $arr1[5];//month         echo "$arr1[6]/";//month         echo $arr1[1];//year         echo $arr1[2];//year         echo $arr1[3];//year         echo $arr1[4];//year         echo " $arr1[9]";//time -h         echo "$arr1[10]:";//time -h[/code] It works fine. But is there a more efficient way of doing the same thing bacause it seems a lil long winded. Thanks
  15. Well the way the date is stored is; $time = date('l dS \of F Y h:i:s A'); and $time is inserted into the database. Any suggestions??
  16. Hi there people... I have the following table in my database activity (activityID, userID, time, page) It keeps track of which page the users have visited and when, a bit like big brother i guess. I have just finished a view activity script, where the user enters the name of a user and the script outputs the activity of the user specified. However, if the user has been busy, this can be many (100's) of rows of data. I need to allow the user to search a specified date range, i.e. 15 January 2005 - 15 January 2006. How can i do this??? The date is stored as; Friday 24th of February 2006 05:24:39 PM Any suggestion??? Regards pps
  17. The cost thing was an example...i was illustrating what the problem i a, having is. For example, when i search for a customer $query = "SELECT * FROM customer WHERE name = '$name'"; I get output everything where name = '$name' as well as every row which does not have an entry for name in the customer table. Any help any1???
  18. Hi there. This should be a quickie... I am inserting data into my database as below; [code] $query = "INSERT INTO product VALUES ('','$prodName','$prodDesc','$supplier','$costPound', '$costPence')";     mysql_query($query);      [/code] All values are passed from a form and its all working fine. I then want to query the databse and output products searched for by the user. e.g. [code] $query = "SELECT * FROM product WHERE productID = '$ID' OR prodName = '$prodName' OR prodDesc = '$prodDesc' OR supplier = '$supplier' OR costPound = '$costPound' OR costPence = '$costPence'"; $result = mysql_query($query); $num = mysql_numrows($result); [/code] The problem is when the user specifies he/she wants the output contain the row he/she wants but also all other rows that contain the value 0. for example if a product cost £10.00 this is output because in the costPence column the value exists as 0. How can i avoid this? Is there a method or some logic that i need?? Thanks in advance as always ppl!
  19. Its working. I changed it slightly because i was getting a lot of null values output. I changed it to $query = "SELECT * FROM customer, `case` WHERE customer.ID = `case`.custID"; Now in $query i get a data which contains all customers with case history. Now i need to get from that data those customer the user has searched for. Using a form i have the value $name, $surname etc.. how can i search these from $query?? Or do i need to do something with the $query i.e. "SELECT * FROM customer, `case` WHERE customer.ID = `case`.custID WHERE custID = $custID AND name = $name" Hope this makes sense Thanks in advance
  20. I have tried that and the error i get is; #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'case ON customer . custID = case . custID LIMIT 0, 30' at line 1 I don't understand why. Does anyone else???
  21. The tables are actually like; customer(custID, name, surname, email) case(caseID, custID, date) custID links the two together.i still can't get then query to work. I have tried; SELECT * FROM customer, case WHERE customer.ID = case.custID and SELECT * FROM case LEFT JOIN customer ON case.custID = case.custID Still no luck. Read the manual and its still no good.
  22. Hi there ppl! I am trying to create a table by querying two database tables but am getting stuck. e.g. One table is case(caseID,priority,created,subject) The other is customer(custID,name,surname,phone) Now my table - i want it to look something like this; CASEID PRIORITY CREATED SUBJECT NAME SURNAME PHONE 1 4 1/2/2006 php jim bob 999 etc... Normally you'd have a while loop, going through the database table then adding to the html table as $i incremented. But what do u do when there is two loops??? NE HELP??? thnks in advance
×
×
  • 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.