Jump to content

Tauheed

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by Tauheed

  1. 15 hours ago, niche said:

    What kind of duplication do you have in both tables?

     

     

     

     

    ID from the sales table and customer id from the customer table are the same. Customer ID is primary key in customer table and id is foreign key in sales table. Thanks 

  2. I don't have MySQL experience, I need some help to write a query for my work. I need a query that count transaction for a week, for example, I wanna run the query every Friday and want to see the result from last Friday to Thursday, I mean just last week's data. The start date is last Friday (11/12/2021) and the End date is Thursday (11/18/2021). It is a weekly process that I can run every week to download the output. 

    There are two tables, sales, and customers. The customer table has fields such as "customer_id", FirstName, LastName, etc and the sales table has "id" which is the same as customer_id from customer table, salesDate, etc. 

    I want to count data of those who are customer_id match to the sales table. I would like to ignore some of the users as well like our IT team has a couple of test users that uses for testing. for example testuser1 and testuser2. I would like the query to not count these two users.

    Here is an example that I want to make work. Can someone please help me to write the query? 

    SELECT COUNT(CustomerID) AS NumberOfCustomer FROM Customer
    INNER JOIN Sales ON ID = CustomerID
    where user != (testuser1 and testuser2
    where sales date between last Friday to Thursday;

     

    Thanks!

     

  3. I created a mobile navigation menu which display navigation icons in the bottom of the mobile screen. I linked google icons page where I'm taking the icons. All 5 icons are displaying in the bottom of screen, however now I'm stuck and don't have an idea how to add links of pages in the menu bar. I mean there is icon with three bar for main menu, like I want to add contact.html, blog.html, images.html in that icon. I mean whenever user click on the three bar it should display the links of these pages where user can click on of those and read. I appreciate your help.

    Here is the html code

    Quote
    <!DOCTYPE html>
    <html>
    <head>
    <title>Mobile Bottom Navigation</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf8">
    <link rel="stylesheet" href="styles.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons"
    rel="stylesheet">
    </head>
    <body>
    <div class="bottom-nav">
    <a href="index.html" class="nav-link">
    <i class="material-icons nav-icon">home</i>
    <span class="nav-text"> Home </span>
    </a>
    <a href="about.html" class="nav-link nav-link-active">
    <i class="material-icons nav-icon">message</i>
    <span class="nav-text"> About </span>
    </a>
    <a href="create.html" class="nav-link">
    <i class="material-icons nav-icon">create</i>
    <span class="nav-text"> Create Post </span>
    </a>
    <a href="account.html" class="nav-link">
    <i class="material-icons nav-icon">person</i>
    <span class="nav-text"> Account </span>
    </a>
    <a href="#" class="nav-link">
    <i class="material-icons nav-icon">menu</i>
    <span class="nav-text"> Menu </span>
    </a>
    </div>
    </body>
     
    </html>

    here is the CSS code

    Quote
    body {
    margin: 0 0 55px 0;
    }
     
    .bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 55px;
    box-shadow: 0 0 3px rgba(0. 0. 0. 0.2);
    background-color: #ffffff;
    display: flex;
    overflow-x: auto;
     
    }
     
    .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-width: 50px;
    overflow: hidden;
    white-space: nowrap;
    font-family: sans-serif;
    font-size: 13px;
    color: #444444;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.1s ease-in-out;
    }
    .nav-link:hover {
    background-color: #000000;
    }
    .nav-link-active {
    color:#009578;
    }
    .nav-icon {
    font-size: 18px;
    }

     

  4. Hi folks,

    There is a third party application, which supports javascript. It gives modification options. I would like to write a script in which it searches a file from ElasticSearch, if it finds the file then it should attach the file. I'm not good with javascript, just I started learning it for the last few days. Can someone help me, please? I really appreciate it.

  5. Dear Experts, i have created a arabic to persian to english dictionary, whenever i will enter english keyword to search box it will show the result, but when i will type persian and arabic word in box it will show zeero result, actually i have saved alots of arabic and persian words in my databse. i have saved all file using encoding "UTF-8". i dont know where i need to change. both pages source codes are mentioned below. please help me i will be thankful for this kindness. index.php <html><head><link rel="stylesheet" type="text/css" href="style.css" /><title>Dictionary</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script type="text/javascript" src="ajax.js"></script><script type="text/javascript"> function getScriptPage(div_id,content_id,get_count){subject_id = div_id;content = document.getElementById(content_id).value;http.open("GET", "script_page.php?content=" + escape(content)+"&count="+get_count, true);http.onreadystatechange = handleHttpResponse;http.send(null);} </script><link href="styles.css" rel="stylesheet" type="text/css"></link></head> <body><div class="ajax-div"><div class="input-div">Enter Search Keyword here :<input type="text" id="text_content" size="40" onKeyUp="getScriptPage('count_display','text_content','1')"><input type="button" class="button" value="Search" onMouseUp="getScriptPage('output_div','text_content','0')"><div id="count_display"> </div></div><div class="output-div-container"><div id="output_div"></div></div></form></div></body></html> script_page.php <link rel="stylesheet" type="text/css" href="style.css" /><?php// You can do anything with the data. Just think of the possibilities!include('conn.php'); $strlen = strlen($_GET['content']);$display_count = $_GET['count']; $select = "select * from dic where (english like '%".$_GET['content']."%') or (arabic like '%".$_GET['content']."%') or (persian like '%".$_GET['content']."%')";$res = mysql_query($select);$rec_count = mysql_num_rows($res); if($display_count){echo "There are <font color='red' size='3'>".$rec_count."</font> matching records found.Click Search to view result.";}else{?> <center> <table class="sofT" cellspacing="0" border="1"><tr><td colspan="5" class="helpHed" align="center">Search Result</td></tr><tr> <td class='helpHed'>English</td> <td class='helpHed'>Arabic</td> <td class='helpHed'>Arabic Roman</td> <td class='helpHed'>Persian</td> <td class='helpHed'>Persian Romant</td> </tr><?phpif($rec_count > 0){while($data=mysql_fetch_array($res)){echo "<tr><td class='sup'>".$data['english']."</td><td class='sup'>".$data['arabic']."</td><td class='sup'>".$data['aroman']."</td><td class='sup'>".$data['persian']."</td><td class='sup'>".$data['proman']."</td> </tr>";}}elseecho '<td colspan="5" align="center"><FONT SIZE="2" COLOR="red">No matching records found....!</FONT></td>'; }?></center>

  6. I want to connect any other website to my website. i mean in a website there are examination results added, i just want that a small part of that website (screen shot enclosed) should appear in my website, and that website name should not be appear there. my be centeral part of that web. I just want that user should check there result in my website. is there any code for linking like that? please help me i will be thankful for this kindness.

    post-135815-0-48492000-1366615449_thumb.jpg

  7. Dear Friends, i am trying to make ajax search engine, whenever i will enter text in search field and click on button then search result will not appear. please help me. screen shot and source codes are mentioned below.first page <html><head><link rel="stylesheet" type="text/css" href="style.css" /><title>Ajax Search</title><script type="text/javascript" src="ajax.js"></script><script type="text/javascript"> function getScriptPage(div_id,content_id){subject_id = div_id;content = document.getElementById(content_id).value;http.open("GET", "search.php?content=" + escape(content), true);http.onreadystatechange = handleHttpResponse;http.send(null);} </script><link href="styles.css" rel="stylesheet" type="text/css"></link></head> <body><div class="ajax-div"><div class="input-div">Enter Search Keyword here :<input type="text" id="text_content" size="40"><input type="button" class="button" value="Search" onMouseUp="getScriptPage('output_div','text_content','0')"> </div><div class="output-div-container"><div id="output_div"></div></div></form></div></body></html> 2nd pagesearch.php <?php mysql_connect("localhost", "root", "root") or die("Error connecting to database: ".mysql_error()); mysql_select_db("mysql") or die(mysql_error()); ?> <html><head> <title>Search results</title> </head><body><?php $query = $_GET['content']; // gets value sent over search form $min_length = 1; if(strlen($content) >= $min_length){ // if query length is more or equal minimum length then $query = htmlspecialchars($query); $query = mysql_real_escape_string($query); $raw_results = mysql_query("SELECT * FROM customer_table WHERE `id` = $content") or die(mysql_error()); if(mysql_num_rows($raw_results) > 0){ // if one or more rows are returned do following echo "<table border='1'><tr> <th><h2>Id</h2></th><th><h2>Name</h2></th><th><h2>Regestration No</h2></th><th><h2>Remarks</h2></th></tr>"; while($results = mysql_fetch_array($raw_results)){ echo "<tr>"; echo "<td> " . $results['id'] . "</td>"; echo "<td>" . $results['name'] . "</td>"; echo "<td>" . $results['reg'] . "</td>"; echo "<td>" . $results['remarks'] . "</td>"; echo "</tr>"; }echo "</table>"; } else{ // if there is no matching rows do following echo "No results"; } } else{ // if query length is less than minimum echo "Minimum length is ".$min_length; } ?></body></html>

    post-135815-0-79321400-1366097165_thumb.jpg

  8. Dear sir, i need some more help about my search engine, i just want that my search result should show in first page, i mean without loading. Some 1 told it is possible with the help of ajax, but i dont have any idea about ajax. Please help me i will be thanlful, my both pages source codes are mentioned above.

  9. Dear sir, i need some more help about my search engine, i just want that my search result should show in first page, i mean without loading. Some 1 told it is possible with the help of ajax, but i dont have any idea about ajax. Please help me i will be thanlful, my both pages source codes are mentioned above.

  10. Dear sir, i need some more help about my search engine, i just want that my search result should show in first page, i mean without loading. Some 1 told it is possible with the help of ajax, but i dont have any idea about ajax. Please help me i will be thanlful, my both pages source codes are mentioned above.

  11. In your SQL query you need to add "WHERE customer_id=1"
    Dear then if i want to search an other record suppose 5,6 etc then? it is complete mysql search engine, for seaching every record it is not possible to change customer id every time.i just wanna to say whenever i will enter keyword in search box then required record should be appear on the page. but now whenver i will enter keyword in search box suppose 1, every reocrd have 1 (1,11,12,13...21,31,41,91,101 etc) that will appear and if i will enter 2 every records have 2 (2,12,20,21...32,42,92,102 etc) that will appear, i mean when i will enter 1 in search box then that recrod id is 1 should be appear. please help me, i will be thankful for this kindness.
  12. I have created a search engine to find records which are added in mysql database, whenever i will enter customer id to find record all records appear, suppose a customer id is 1 and when i will enter 1 then data of 11,12,13,....21,31,101 etc also appear on my page, both pages source code are mentioned below. please help me i m in deep trouble. i will be thankful for this kindness. index.php <html><head> <title>Search</title> </head><body> <form action="search.php" method="GET"> <input type="text" name="query" /> <input type="submit" value="Search" /> </form></body></html> -------------------------------------------------------------------------------------search.php <?php mysql_connect("localhost", "root", "root") or die("Error connecting todatabase: ".mysql_error()); mysql_select_db("mysql") or die(mysql_error()); ?><html><head> <title>Search results</title> </head><body><?php $query = $_GET['query']; $min_length = 1; if(strlen($query) >= $min_length){ $query = htmlspecialchars($query); $query = mysql_real_escape_string($query); $raw_results = mysql_query("SELECT * FROM result WHERE (`rollno` LIKE '%".$query."%')") or die(mysql_error()); if(mysql_num_rows($raw_results) > 0){ echo "<table border='1'><tr><th><h2>Roll No</h2></th><th><h2>Student Name</h2></th><th><h2>Marks Obtained</h2></th><th><h2>Remarks</h2></th></tr>"; while($results = mysql_fetch_array($raw_results)){ echo "<tr>"; echo "<td> <h3><center>" . $results['rollno'] . "</td></h3></center>"; echo "<td><h3>" . $results['name'] . "</td></h3>"; echo "<td><h3><center>" . $results['marks'] . "</td></h3></center>"; echo "<td><h3><center>" . $results['remarks'] . "</td></h3></center>"; echo "</tr>"; }echo "</table>"; } else{ echo "No results"; } } else{ echo "Minimum length is ".$min_length; } ?></body></html>

×
×
  • Create New...