Hi All, I am building an eCommerce website and I really new to PHP and MYSQL but loving the challenge. On my website I have 9 different categories of products with each page having about 8 items to sell. Rather than duplicating the code from each .php/.html file into a new file and change the SQL query, is it possible to write a script that says when the user clicks on category1 in the navigation bar, show all the products in category1? Hope this makes sense. Thanks in advanced.

Member Avatar
Member Avatar
+2 forum 7

Hello please i have a download webpage which allow users to download mp3 files. I want to display the number of times a user has click the download button and display it on the webpage. The records are in a database and this is my code. This is my download button which will be click to update my record count... <a href="file.php?id=<?php echo $row['song_id']; ?>" class="btn btn-primary"><i class="fa fa-download"></i></a> My database looks like this... song_id song artist filename download xxx xxx xxxx xxxx xxxx I want the count to update the download column anyt time a button is clicked. Any …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a problem with my homework assignment. I am able to access the database and insert new customer but it doesn't work when i try to update any record. if anyone can tell me what is wrong with my code. thank you so much this is all my code [CODE]using System; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Configuration; using System.Data; public partial class CustomerEdit : System.Web.UI.Page { String CustomerID = ""; protected void Page_Load(object sender, EventArgs e) { this.Master.HighlightMenu = "Customers"; if (Request.QueryString["id"] != null) { CustomerID = Request.QueryString["id"]; Label1.Text = CustomerID; txtFirstName.Text = ""; txtLastName.Text = ""; txtEmailA.Text …

Member Avatar
Member Avatar
+0 forum 9

All Time Show Null value Please help me what is the wrong in my code declare @mxdbvlu int declare @dbvlunm int set @mxdbvlu= (select max(Database_name) from TBL_FY_SELECT_1) if @mxdbvlu = null set @dbvlunm=1000 else set @dbvlunm=sum(@mxdbvlu+1) select @dbvlunm,@mxdbvlu

Member Avatar
Member Avatar
+0 forum 1

Hi Pobably it is going to be repeated question but I wasnt able to find such thread. I just would like to do sql through C++ and I have 2008 ms database. What are free libraries available for doing such job? Thanks

Member Avatar
Member Avatar
+0 forum 3

I have a table where I want to update "time 2" row, in the user's last "time 1" entry. I was try this, but not function.

Member Avatar
Member Avatar
+0 forum 4

A long shot I know but a colleague has left, leaving behind a couple of access databases that query each other and a sql database, unfortunately one of the databases querys now takes a long time to run to the point that the excel report calling the query timeouts. is it easy for any body to see what might cause it to take so long to run or how i could possible speed it up the SQL for the query is attached below SELECT [Machine Rates].Group, [SFDC time transactions log].Machine, Calendar.FFPDATE_0 AS [Date], [SFDC time transactions log].TranTime, [SFDC time transactions …

Member Avatar
Member Avatar
+0 forum 1

i have made leaves managment system ,now i want to mentioned leaves days in attendance register if employee take leave from 1-1-2019 to 4-1-2019 then 5 day display in attendance register as a (L) . kindly guide me how it will get done. here is my attendance register query in pivot table. SELECT DISTINCT ReportingDate INTO #Dates FROM EmployeesAttendance WHERE (ReportingDate BETWEEN @StartDate AND @Enddate) ORDER BY ReportingDate DECLARE @cols NVARCHAR(4000) SELECT @cols = COALESCE(@cols + ',[' + CONVERT(varchar, DATEPART(DAY, ReportingDate), 112) + ']','[' + CONVERT(varchar,DATEPART(DAY, ReportingDate), 112) + ']') FROM #Dates ORDER BY ReportingDate -- Building the query with …

Member Avatar
+0 forum 0

I am using web server as LIGHTTPD....database as sqlite3....And php.. I made my flash memmory of nanopi as readonly(in fstab). while content listing from database to web page it is showing only limed amount of data( for example...in a webpage i am given to list 55 records.but beacuse of this readonly file system it is listing 19 records and no pagination.) How to make readonly filesystem without affecting above

Member Avatar
+0 forum 0

I have a table that contains some cubes with servers and active status (see attached image): note: CUBE1 is repeated intentionally. The idea is the same cube is getting synced from the same server 1 as a data source (process_server) onto different target servers (query_server; say server2 is in region A and server 3 is in region B). The way the environment is set up is both servers have to be active/active status (meaning TRUE) except for some additional test cases, i am setting to false sometimes one or the other. I have the following script now calling the cube …

Member Avatar
Member Avatar
+0 forum 2

Previously used winXP operating system running normally (very good) when switching to win7 operating system, this error, read errors from the SQL Server data, what is the error ? http://www.mediafire.com/view/4q5ux6e66ds4avb/ErrorOpenSQL.jpg/file

Member Avatar
Member Avatar
+0 forum 1

I have a form that uploads a news article with it's picture and then stores all the info correctly. I am using codeigniter with Active Record and would like to know how to display the image with the post it was uploaded with. here is my upload script: public function create(){ $data = array('error' => ''); $config = array( 'upload_path' => './uploads', 'allowed_types' => 'gif|jpg|png', 'max_size' => '204800', 'max_width' => '1920', 'max_height' => '1080', 'encrypt_name' => true ); $this->load->library('upload', $config); if(!$this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); $data['title'] = 'Create a news item'; $data['main_content'] = 'news/create'; $this->load->view('templates/template', $data, $error); } …

Member Avatar
Member Avatar
+0 forum 4

Hello people, I've been working on a registration form project that needs to contain a captcha code that will be validated. Even if the captcha string inserted in the text box is correct, it displays the error "Captcha string is incorrect". Also, even if the captcha part did not exist, the form doesn't seem to save the data to my sql database. Can anyone please try to help me out or check if you can notice any obivous errors with my code? The following code is the PHP and HTML code used for the registration form <?php session_start(); $_SESSION['captcha'] = …

Member Avatar
Member Avatar
+0 forum 1

How to copy a store procedure one to another database in same server I work on a project. I want copy all or single store procedure from old financial year **db_17_18** to new financial year **db_18_19** I want to do it using sql server command. i try it but showing error Please help me.... i used : SQL_Server 2008 r2 server name : shop04 **What I have tried:** **try 1** select * into DB_18_19.dbo.P_Add_FY_Data.procedures from DB_17_18.P_Add_FY_Data.procedures WHERE type_desc='SQL_STORED_PROCEDURE' **Error1 :** Msg 117, Level 15, State 1, Line 1 The object name 'DB_18_19.dbo.P_Add_FY_Data.procedures' contains more than the maximum number of prefixes. …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys! I have a website but we don't host in GoDaddy or any hosting website, because we use SQL database. And we have a large database that we are using , the website is for productions. We store a lot of data. We use the IP address because we port forward it so that we can use it anywhere. Now, we are worried because we are exposing our IP address outside, and it might be the reason for hackers or any attacks to come to us. Can you help me or give me an Idea how can I change …

Member Avatar
Member Avatar
+0 forum 15

I'm a newbie in php and I want to create a single login page for Admin and user.When admin log in it should go to an admin page and when user log it shoult go to index page.I want help with my code, it works fine login normal users but i try it addind the admin part and it doesn't seem to work .Please help and Thanks in advance .. This is my validation code for the login <?php if(!empty($_POST)){ if(isset($_POST["username"]) &&isset($_POST["password"])){ if($_POST["username"]!=""&&$_POST["password"]!=""){ include "conexion.php"; $user_=null; $sql1= "select * from user where (username=\"$_POST[username]\" or email=\"$_POST[username]\") and password=\"$_POST[password]\" "; $query = …

Member Avatar
Member Avatar
+0 forum 6

Hi there, i'm trying to create a class schedule for subjects where students can view what's available and later on book a position in a class. Here are the images of what i'm trying to achieve: https://imgur.com/a/Ie4XO I want to retrieve the table name and ID of students that have booked a place in a class from the subject table and show them in the main table in the correct time slot. Is there any online resouces which can help me achieve this? i have already created the tables in my database, the tables but having issues on how to …

Member Avatar
Member Avatar
+0 forum 6

Can you help me to programe a window pop up in my site say in it write your email which code should i use in html and javascript

Member Avatar
Member Avatar
+0 forum 2

I need to insert an imagen into a SQL Server Database and i need to do it using jsp, but i don't know how to do it. Someone can teach me the best way to do that?

Member Avatar
Member Avatar
+0 forum 1

<?php $db = new Db(); $mysqli = Db::$_mysqli; if (isset($_POST['name'])) { $name = escape($_POST['name']); $email = escape($_POST['email']); $phone = escape($_POST['phone']); $password = escape($_POST['password']); $result = array(); /*check email is unique*/ $email_num = $db->GetNum("user","email='$email'"); if ($email_num == 0) { /*insert into database*/ $md5password = md5($password); $insert = $db->Insert("user","'','$name','$email','$phone','$md5password'"); /*success*/ if ($insert) { $result['type'] = "success"; $result['message'] = "Your are Register"; /*login the user in*/ session_start(); $_SESSION['id'] = mysqli_insert_id($mysqli); }else{ /*error*/ $result['type'] = "error"; $result['message'] = "Error Please Try again."; } }else{ $result['type'] = "error"; $result['message'] = "Email Already Register <span class='text-bs-primary'>Please Login</span>"; } if(!$error) { $sql="select * from user where (name='$name');"; …

Member Avatar
Member Avatar
+0 forum 2

This the code in products <?php require_once("inc/header.php"); require_once("inc/navbar.php"); /* if user is logged in then only allow the user to view the page */ if (!isset($_SESSION['id'])){ echo "<h1 class='text-center text-upper text-bs-primary'>please login to view your cart <a class='text-black' href='login.php'>Login</a></h1>"; exit(); } else{ $user_id = $_SESSION['id']; } $carts = $db->FetchAll("*","cart","user_id='$user_id' AND active='y'","`id` DESC"); if (empty($carts)) { echo "<h1 class='text-center text-bs-primary text-25 text-upper'>your cart is empty <a class='text-black' href='products.php'>Go Shop</a></h1>"; exit(); } ?> <div class="container padding-10"> <div id="cart-container-main"> <div class="text-center text-20 text-bold" id="cart-message"></div> <table class="table"> <th>Product image</th> <th>Product detail</th> <th>Price</th> <th>Tax</th> <th>Subtotal</th> <th>Remove</th> <tr> <?php $cod= 0; $main_subtotal = 0; $main_shipping_charge = …

Member Avatar
+0 forum 0

When i run the statement below i am getting a number of xxx.xxxx can anyone help me change this to two DP? (SELECT sum(oht_net) FROM order_header_total JOIN order_header ON oh_id = oht_oh_id WHERE oh_cd_id = cd_id AND oh_sot_id = 1 AND DATEPART(yyyy, oh_datetime) = (SELECT DATEPART(yyyy, GETDATE()) -1))

Member Avatar
Member Avatar
+0 forum 2

automatically duplicate rows in sql server 2008 r2 select query i have two table name 1) tbl_Stock_Journal 2) tbl_Stock_Journal_Details i run a select query with where condition i have 5 data in table1 and in table 2 have 3 data when i run the query result is showing 15 row the query show on date wise i want to maximum data show and if other table in same date have no number of data then show blank or null please help me..... ALter proc P_GetStockJournalRPT -- 'all', 'all','2018-07-10' , '2018-07-10' @SJItmID varchar (100) , @SJDItmID varchar (100) , @Sdate date, …

Member Avatar
Member Avatar
+0 forum 4

we r trying to insert date from datetime picker into mssqlserver 2005 but it also enter defult time(00:00) with it in database. using we want only date... [CODE]& xyzdtp.value.date &[/CODE]

Member Avatar
Member Avatar
+0 forum 12

Hello, I am planning to do my Thesis on SQLIA and now I am trying to understand something about SQLrand. SQLrand - a system for preventing SQLIA against web servers. The main intuition is that by using a randomized SQL query language, specific to a particular CGI application, it is possible to detect and abort queries that include injected code. Now, I do not understand how to randomized the SQL query language? https://www.w3schools.com/sql/func_sqlserver_rand.asp is that how you randomize the SELECT SQL command ? Please gives me some guidelines. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 3

Hey everyone i am just asking for a little bit off help if thats fine how can i make 11 fetch scripts into 1 script please [database ](https://i.imgur.com/BTGQF1P.png) i like to make this menu to display the coins i know you can do it but i dont know how since am not pro <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Pick a coin</a> <div class="dropdown-menu"> <a class="dropdown-item" id="pills-btc-tab" href="#pills-btc" role="tab" data-toggle="pill" aria-controls="pills-btc"><img src="https://i.imgur.com/h2bZxBg.png" width="23" height="23"> Bitcoin</a> </div> </ul> fetch from mysqli i have btc here but i like to get every …

Member Avatar
+0 forum 0

Hi I am struggling with some code and was wondering any someone could please help me. My php skills are VERY limited and only get stuff done by reading forums like this and watching YouTube videos :-[. I am enjoying learning so that is why I am sticking with it and not reverting back to html which I am pretty well accomplished at. I have a phpMyAdmin database with 75 entries. My site has pagination setup where it shows 10 entries per page. I have setup one column in my database with enum and the values are 0, 1, 2, …

Member Avatar
Member Avatar
+0 forum 6

hello hope you all are going well, so my vacation is comming and i was wondering whta if i did a big project or small project, how hard is it to make my own multivendor website like amazon, i would like to do everything like the code in php, the database in mysql, without usinng platform like magento ! what is the steps to follow and do you have resources or link to any book or tutorial ?

Member Avatar
Member Avatar
+0 forum 10

I have been cracking my head on this mater in the past couple of days. I am faced with a situaton where i need to write a MySQL equivalent of PHP code to loop through sql select results. The Php code looks like this $query = "SELECT pubid, author FROM refs"; $sql=$con->prepare($query); $sql->execute(); $sql->setFetchMode(PDO::FETCH_ASSOC); while ($row=$sql->fetch()){ $id= $row['pubid']; $author = $row['author']; $name = explode('., ', $author); } How can one write sql/mysql query that does the same?

Member Avatar
Member Avatar
+0 forum 6

I have two tables like below tb1 Date Cr Dr 2018-04-29 100 50 2018-04-30 0 150 2018-05-01 250 100 2018-05-02 150 100 2018-06-10 300 250 2018-06-11 0 50 tb2 Date Cr 2018-05-01 350 2018-05-02 250 2018-06-10 300 2018-06-11 100 2018-06-15 200 2018-06-18 100 I need the following Result Apr May Jun Cr 100 1000 1000 Dr 200 200 300 Basically I have to add the respective Cr columns from both table and get the Dr from tb1 for the corresponding dates and create a monthly report. I have tried SELECT Date(tb1.Date) as sDate, SUM(tb1.Cr+tb2.Cr) sumcr, SUM(tb1.Dr) sumdr FROM tb1,tb1 WHERE …

Member Avatar
Member Avatar
+0 forum 7

The End.