ive been develop a project known as ordering system i need to delete data from db by clicking the button ive follow a tutorial from utube and to the exact same code he been used error "object reference not set to an instance of an object" ive double check my db dan the code in vb, there nothing wrong i hope some could help me code used for db : Private Sub Delete(id As String) Dim str As String = "server = localhost; userid = root; password = 1234 ; database = kedaikopimamba_db" Dim MysqlConnection As New MySqlConnection(str) MysqlConnection.Open() Dim …

Member Avatar
Member Avatar
+0 forum 6

SAMPLE TABLE 1 =================================== product Division sales % =================================== product1 divsion1 99 product2 divsion1 51 product3 divsion1 50 product4 divsion2 98 product5 divsion2 41 product6 divsion2 40 product7 divsion3 97 product8 divsion3 31 product9 divsion3 30 =================================== Expected output 1 =================================== product2 divsion1 51 product3 divsion1 50 product5 divsion2 41 product6 divsion2 40 product8 divsion3 31 product9 divsion3 30 Hi All, I am having a single table. In this table I need to get product name which is not having maximum sale % for each division. Please help me to get this results. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 6

there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb. ‚Äč both snippets work, my question is;** Is my join correctly formatted? ** select concat(personTb.p_fName,' ',personTb.p_mName,'. ',personTb.p_lName) AS Name, concat(addressTb.a_street,' ',addressTb.a_box,' ',addressTb.a_city) AS Address, concat(churchTb.c_name,' ',churchTb.c_city) AS Church from personTb, addressTb, churchTb where addressTb.a_ID= ( select personAddress.a_ID from personAddress where personAddress.p_ID=personTb.p_ID ) AND churchTb.c_ID= ( select personChurch.c_ID from personChurch where personChurch.p_ID=personTb.p_ID ); /* next is my attempt at a join */ SELECT concat(a.p_fName,' ',a.p_mName,'. ',a.p_lName) AS Name, …

Member Avatar
Member Avatar
+0 forum 3

Hello, please check the attachment for details. What i need is : The sum of all the full_trade_amount for that route The list of routes that share a customer with that route The number customers shared with that route The number of columns with data can vary so a route could share customers with many many routes so don't limit the number of columns for routes.

Member Avatar
Member Avatar
-2 forum 1

I wrote a modify password file, but unfortunately, the MySQL query is throwing error: Warning: mysql_query() expects at most 2 parameters, 3 given in admin\modify-password.php on line 40 This is the PHP code: if (mysql_query("UPDATE admin SET hash = ? WHERE admin_id = ?", crypt($_POST["newpassword"]), $_SESSION["admin_id"]) === false) I modified the code like this, and it produced a different error message: if (mysql_query("UPDATE admin SET hash = ? WHERE username = 'admin'", '$newpassword') === false) The second error message: Warning: mysql_query() expects parameter 2 to be resource, string given in admin\modify-password.php on line 40 Here is the full code: <?php …

Member Avatar
Member Avatar
+0 forum 5

I'm Beginner. I need help, please. I am having a small problem in the script I am have in this script ( admin folder) Add contain articles (This page is working to add threads only) My problem in the Page (read_mor.php) i make a query with the database to bring news this is query . [CODE] <?php include ('config/connect_to_mysql.php'); $id = $_GET["id"]; $fetch = mysql_query("SELECT * FROM posts WHERE id= '$id' ") or die(mysql_error()); while($myrow = mysql_fetch_assoc($fetch)) { ?> <?php echo $myrow['title']; ?> <?php echo $myrow['created_on']; ?> <?php echo $myrow['categories']; ?> <?php echo $myrow['description']; ?> <?php echo $myrow['categories']; ?> <?php …

Member Avatar
Member Avatar
+0 forum 7

lastlogin is getting saved as time() in my mysql table and it is varchar mode. querying the database to send out emails to remind my users that they have not logged in from past 30 days SELECT * FROM members WHERE lastlogin = DATE_SUB(CURDATE(), INTERVAL 30 DAY) i tried with several options, but not able to query exactly as i need. for example, SELECT * FROM members WHERE lastlogin < DATE_SUB(CURDATE(), INTERVAL 30 DAY) SELECT * FROM members WHERE lastlogin < DATE_ADD(CURDATE(), INTERVAL 30 DAY) can some one help me on this to achieve this function please.

Member Avatar
Member Avatar
+0 forum 8

Hi, I am making a website for a car database. I made a table called Cars with fields Name,Make,Model,Color,Doors. I have also made a search function: [CODE]SELECT * FROM Cars WHERE Name LIKE '%$search%'[/CODE] This is a general search that will search the whole table, but what if I wanted a filter on it like a scroll down list for car colors or a check box for 4 door that will give me a search result. e.g I am looking for a car named Civic but I only want it to be black and 2 door. And one extra added …

Member Avatar
Member Avatar
+0 forum 4

Hi, I am making a website for a car database. I made a table called Cars with fields Name,Make,Model,Color,Doors. I have also made a search function: [CODE]SELECT * FROM Cars WHERE Name LIKE '%$search%'[/CODE] This is a general search that will search the whole table, but what if I wanted a filter on it like a scroll down list for car colors or a check box for 4 door that will give me a search result. e.g I am looking for a car named Civic but I only want it to be black and 2 door. And one extra added …

Member Avatar
Member Avatar
+0 forum 1

Hi everyone, I'm new to mySQL. I have a table like this one: [ICODE]+-------+-------+-------+ | date | plant | value | +-------+-------+-------+ | date1 | 1 | 10 | | date2 | 1 | 12 | | date3 | 1 | 15 | | date4 | 2 | 30 | | date5 | 2 | 34 | | date3 | 2 | 43 | +-------+-------+-------+[/ICODE] The result I want is "the last (more recent) value for each plant". I mean [ICODE]+-------+-------+-------+ | date | plant | value | +-------+-------+-------+ | date3 | 1 | 15 | | date5 | 2 …

Member Avatar
Member Avatar
+0 forum 4

Hi, All i want to show is the 'fr_players' to have two categories of 'fr_nations' and 'fr_clubs' and fetch the names from the foreign id... Here what i have done so far but it doesnt shows any error or return any tables either: [CODE]SELECT a.id as club_id, a.fr_name as club_name, b.id as nation_id, b.fr_name as nation_name, c.id as player_id, c.fr_fname as player_name" ." FROM fr_clubs as a INNER JOIN fr_nations as b ON a.id = b.club_id INNER JOIN fr_players as c ON b.id = c.nation_id" ." LIMIT $paginate->start, $paginate->limit[/CODE] here is the table structure: [CODE] CREATE TABLE IF NOT EXISTS …

Member Avatar
Member Avatar
+0 forum 12

I'm working on an auction script for a client. This portion of the script pulls all the open auctions from the database and allows bidding, but they only want bidding on auction with 30 seconds left until it ends. [CODE] $query = "select * from DSI_auctions WHERE closed='0' AND suspended='0' AND "; $query .= "starts<=".$NOW." order by ends LIMIT ".$SETTINGS['endingsoonnumber']; $result = mysql_query($query); $num_auction = mysql_num_rows($result); //echo $num_auction; [/CODE] I've thought of having the script change the current time and ending time to epoch and determinig the difference but if I do that it will only return 1 row even …

Member Avatar
Member Avatar
+0 forum 6

I have two table named:[B] Blog[/B] for displaying blogs post and [B]comments[/B] for displaying comments section for each blog post. The fields for these are as follows: [B]For Blog:[/B] 1: blog_id 2: title 3: body 4: author 5: updated [B]For Comments:[/B] 1: comments_id 2: username 3: email 4: comment_body 5: blog_id Now what i want is that suppose for blog_id = "2", I am writing comment, so what would be the insert query so that when i visit index.php?blog_id=2, I get the comments for only that particular post. [B]I mean how to insert the comments for a particular blog_id? [/B] …

Member Avatar
Member Avatar
+0 forum 6

guys, can anyone help me on this problem? i have two tables then what I want is that, when an identical item is found in table2, it will not be displayed. Example: [CODE] Table1 Table2 item1 other1 item2 other2 item3 item2 item4 item3 [/CODE] Condition: if we use this query: [ICODE]select * from Table1[/ICODE] the items from Table1 will appear but if the items of Table1 exists in Table2 then i must not be displayed. how can i do that? thanks

Member Avatar
Member Avatar
+0 forum 2

The End.