Jump to content

Tauheed

Members
  • Posts

    16
  • Joined

  • Last visited

Tauheed's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Tauheed

    MySQL query help

    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. Tauheed

    MySQL query help

    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 here is the CSS code
  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. Is it not possible in HTML?? actually i have better know in HTML than PHP. if it is possible to make every page separate then joint it. I mean button page, header, footer, ad etc....... I will be thankful for your kind reply.
  6. Dear Experts, i have crated my personal page, whenever i need to change in header, buttons and etc, where i will change in each page, now i would like to separate button page, header & footer page, so friends how i can link these pages to my index and other pages.
  7. Dear Sir, please explain, how and where i can use utf8 encode & decode functions. will you please guid me? i will be thankful.
  8. 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>
  9. 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.
  10. 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>
  11. 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.
  12. 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.
  13. 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.
  14. Thank you sir, now it is working. once again a lots of thanks, you resolve this matter. Thank you very much
  15. 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.
×
×
  • Create New...