hai all, i have 2 tables 1)state state contains stateid,statename here stateid is primary key. city contains cityid,cityname,stateid stateid is foreign key. 2)city now state contain 1 ap,2 tamilnadu,3 banglore. city contains chittor 1,madanapalle 1,tirupati 1 katpadi 2 ,kanchi 2 mysore 3 ,chintamani 3 when i select the ap city only shown in drop down list i dont have any code could you please help me any one .

Member Avatar
+0 forum 0

Hi, I do need help with my solo project called Salary Expenses project in PHP and Laravel and I don't see any data for the current month in the **Monthly Expenses page**, even the data is recorded during the current matching month. Can help? My project file: https://drive.google.com/open?id=11qrmVHOwdgiiYQbw981o4y_CNp9DrTUM

Member Avatar
+0 forum 0

I apologize in advance if the title in unclear. I am fairly new to PHP/MySQL programming. I have a script I am working on - I have the login, register setup correctly and working fine. I have the pages restricted so that you're required to login. I am now trying to work on an administration panel, my users table in the database is currently setup as follows; id username password created_at I want to add another column called `is_admin` and the default value set to 0, where if `is_admin` is set to 1 then user is admin. I know how …

Member Avatar
+0 forum 0

I have three tables(table, table2,table3). From table1 i want to return three rows: Title, Desc,time,'products' AS type From table2 i want to return three rows: group_title, group_desc, created,'groups' AS type From table3 i want to return three rows: name, occupation,birth,'users' AS type $sql = "SELECT DISTINCT * FROM (SELECT table1.title, table1.desc, table1.time,'products' AS type FROM table1 ORDER BY rand() LIMIT 5) AS T UNION ALL (SELECT table2.group_name,table2.group_desc,table2.created,'groups' AS type FROM tabl2 JOIN table1 ON table2.id = table1.id ORDER BY rand() LIMIT 5) UNION ALL (SELECT table3.name,table3.occupation,table3.birth,'users' AS type FROM table3 JOIN table1 ON table3.id = table1.id ORDER BY rand() LIMIT …

Member Avatar
+0 forum 0

I have One Problem in my coding ..I want to upload multiple images in the database in one row with using comma ... for($i=0;$i<count($_FILES['eventpic']['name']);$i++) $pic = $_FILES['eventpic']['name'][$i]; $tmp =$_FILES['eventpic']['tmp_name'][$i]; $location="pics/".$pic; move_uploaded_file($tmp,$location); $q="insert into tbl1(title,tdate,eventpic)values('','','$pic')"; echo $q; through this code i can upload tthe multiple images but not in a single row ....

Member Avatar
+0 forum 0

Hello I am using Crystal report version 11.5.8.826, php version 7.0.10, Apache version 42.4.33 and MySql Version 5.7.14. I have created the sampel rptone.rpt file that contents sample report. I want to load that rptone.rpt file using php. With Crystal report 11.5.8.826, php 7.0.10, apache 42.4.33 and MySql 5.7.14 i have tried to connect/load crystal report file that is .rpt file using COM Object but it gives error $my_report = "report/rptone.rpt"; $COM_Object = "CrystalReports115.ObjectFactory.1"; $objCom = new COM($COM_Object, "localhost", 0, ""); $crapp = $objCom->CreateObject("CrystalDesignRunTime.Application"); $creport = $crapp->OpenReport($my_report, 1); This expected to be open rptone.rpt file that must show the report …

Member Avatar
+0 forum 0

I am having problem in submitting this form when I select "1" on the number of setting in html form. The submit button is working if I select 2 in the number of sitting from html form as it will show all the form fields but when I select 1, submit form is not working. I am new to PHP This is my html form <form name="register" method="POST" action="process.php"> <label>Select Number of Sitting(s)</label> <select name="sitting" id="sitting" class="form-control" onchange="showDiv(this)"> <option value="1">1</option> <option value="2">2</option> </select> <div class="output1" id="div1" name="onesitting"> <label>School Name</label> <input type="text" name="schoolname[]" id="schoolname1" class="form-control" placeholder="School Name" required> <label>Exam Type</label> <select …

Member Avatar
+0 forum 0

Hey! I am a bit stuck with my htaccess... let me explain how I want it to work... I have a wildcard subdomain, for example, demo1.domain.com, demo2.domain.com... I want htaccess to take whatever the subpart of the domain is and pass it as a variable... Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_URI} !(/$|\.) RewriteRule (.*) %{REQUEST_URI}/ [R=301,L] RewriteCond %{HTTP_HOST} !^www\.domain.org.uk RewriteCond %{HTTP_HOST} ^(.+).domain.org.uk RewriteRule ^([^/]*)$ http://domain.org.uk/app/index.php?id=%1 [P,L,QSA] This works and I can get the variable ID... I then use the to query a database and get the users database details and settings etc and save them into Sessions... Then I want …

Member Avatar
+0 forum 0

Hi i'm Anis. I want to ask how i can attach image from database in FPDF?

Member Avatar
+0 forum 0

Hello Frds, select box option add new state in add.already same state in condition check already exist using php pdo.please help me.

Member Avatar
-1 forum 0

Hi guys , I have a tables called “scores” With the following Fields AdmNo,Name, Maths,English,Biology ,Avg Am loading this data to my datagridview using select “Select * from scores order by Avg Desc” Which works fine my question is how do i get the rank of every student from the datagridview in the form of Adm Name Maths Eng Biology Avg. rank 1. Peter. 80. 60. 70. 75. 1 2. Alex. 20. 20. 20. 20. 2 Etc How do I rank?

Member Avatar
+0 forum 0

In mysql database i created "leave" table: CREATE TABLE `leave` ( `ID_LEAVE` int(11) NOT NULL, `ID_WORKER` int(11) NOT NULL, `BEGIN_DATE` datetime DEFAULT NULL, `END_DATE` datetime DEFAULT NULL ) INSERT INTO `leave` (`ID_LEAVE`, `ID_WORKER`, `BEGIN_DATE`, `END_DATE`) VALUES (3, 26, '2019-03-20 07:00:00', '2019-03-21 15:00:00'), (4, 22, '2019-03-20 07:00:00', '2019-03-20 15:00:00'); "Workers" table: CREATE TABLE `workers` ( `ID_WORKER` int(11) NOT NULL, `FNAME` varchar(20) NOT NULL, `LNAME` varchar(20) NOT NULL ) INSERT INTO `workers` (`ID_WORKER`, `FNAME`, `LNAME`) VALUES (22, 'ALAN', 'FAST'), (23, 'LEON', 'SPEED'), (24, 'ADAM', 'GREEN'), (25, 'DAVID', 'BUCS'), (26, 'JACK', 'FAR'), (27, 'ADAM', 'GAX'), (28, 'ANDREW', 'WORM'); "Orders" table: CREATE TABLE `orders` …

Member Avatar
+0 forum 0

Hello, So I have buttons on my site connected to a PHP code that updates the column "status" in "users" table with a value based on what button you press. This is the PHP script for that: <?php include('functions.php'); $servername = "localhost"; $username = "root"; $password = ""; $dbname = "emildeveloping"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $id = $_SESSION['user']['id']; if (isset($_POST['108'])) { $sql = "UPDATE users SET status = '10-8' WHERE id='".$id."'"; } if (isset($_POST['107'])) { $sql = "UPDATE users SET status = '10-7' …

Member Avatar
+0 forum 0

Hi, When I was trying to create the IT Request Form and testing it out, I got some problems during the testing. The home page (index.blade.php) ended up getting an error called "Undefined offset: 1", maybe due to the table database problem. ![0TyCAu.png](/attachments/large/4/8730ed8f11be3f5ed672376eee11d83f.png) The checkboxes in the Request Form (requestForm.blade.php) should not be all checked, instead the user has to select a checkbox option. ![0Tyvyx.png](/attachments/large/4/338e30d7d03b784fd3c723e1bf5d80fb.png) Is there a way to fix the form? My IT Request Form project: https://drive.google.com/file/d/1Vpif_1Cxm-Kkw-4_5ZKYt-Tjd1IWJB9_/view?usp=sharing *Please note that the data I entered when testing is fictional (not real).

Member Avatar
+0 forum 0

I'm doing both SELECT and UPDATE queries using named placeholders. But course data from the database doesn't populate form, as expected. The database table row records don't populate, each time I try to edit a course in the browser. I connect to the database usining PDO. And I do SELECT and UPDATE queries using named placeholders. The following is my "modify-course.php": <?php // configuration require("../includes/config.php"); //select a particular admin by id $admin_id = isset($_GET["admin_id"]) ? $_GET["admin_id"] : ''; $stmt = $pdo->prepare("SELECT * FROM admin WHERE admin_id=:admin_id"); $stmt->execute(['admin_id' => $admin_id]); $admin = $stmt->fetch(); # get admin data if (!$admin) { header("Location: …

Member Avatar
+0 forum 0

Hello! I have a problem with a MySQL database that I haven’t been able to solve no matter how much I tried, either with internet guides or with free tools. I really don’t want to pay hundreds of dollars to a company so please, if anyone knows of a solution, help me because I’m desperate. I was running XAMPP 7.1.22 where I had said database and I decided to install XAMPP 7.2.10 without backing up the database. After that, the site wasn’t working so I figured the problem was the database. And indeed PHPMyAdmin wouldn’t recognize it. I reinstalled the …

Member Avatar
+0 forum 0

I send payments to my users regularly. But sometimes the user enter a PayPal email address that cannot receive money from other PayPal users. They just can receive money from their website. How can I check for this and show an error to the user? Do I need to use PayPal IPN, or API? And how?

Member Avatar
+0 forum 0

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

heY guys :) recently I'm on web project which I use MySQL, bootstrap, PHP and Javascript. For this I have generated successfully dynamical forms using PHP. I'm using mysqli commands. I used dynamic forms if it not used I have to create hundred of html pages. So by doing this I could reduce everything to one page. Right so far I'm facing problem 'inserting data to through this dynamic forms'. Exactly I know as I use generate dynamic forms I need dynamic generating code to insert data to database. If not as I mentioned above again I have to create …

Member Avatar
+0 forum 0

I have a script for product Invoice which save details of sold product, but it do not update stock quantity when any product sale. Product quantity in stock remain the same which should decrease.. here is the code to save invoice details using for each loop : <?php function saveInvoice( array $data){ if( !empty( $data ) ){ global $con; $count = 0; if( isset($data['data'] )){ foreach ($data['data'] as $value) { if(!empty($value['product_id'] ))$count++; } } if($count == 0)throw new Exception( "Please add atleast one product to invoice." ); return [ 'success' => true, 'uuid' => $uuid, 'message' => 'Demo Purpose I …

Member Avatar
+0 forum 0

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

echo '<td><a href="details.php?id=' . $row['ServerName'] . '">' . $row['ServerName'] . '</a></td>';--> it's working as expected( but it always display the one table value without any matching criteria hence i am trying with if condition as below) if($row['ServerName']=='DataBase')<< curly start brace>> echo '<td><a href="db.php?id=' . $row['ServerName'] . '">' . $row['ServerName'] . '</a></td>'; <<curly end brace>> -- this above if condition code not working as expected ( updated << curly start brace due to upload issue) i am trying to use if condition if particular pattern match like below where as if i click on Test(under server Name column) if category matches …

Member Avatar
+0 forum 0

<?php session_start(); if (!isset($_SESSION['id'])) { header('location:login.php'); } ?> <?php $nameErr = $emailErr = $usernameErr = $DateOfBirthErr = $departmentErr = $ageErr = $fileToUploadErr = $fileToUploadErrr = $fileToUploadErrrr = $fileToUploadErrrrr = $fileToUploadErrrrrr = "" ; $name = $email = $username = $DateOfBirth = $department = $age = $fileToUpload = $filename = $file = ""; include_once 'connect.php'; $id = $_GET['id']; $query = mysqli_query($mysqli,"select * from `users` where userid ='$id'"); $row = mysqli_fetch_array($query); //set a default variable to hold the original value if $_POST is not triggered $name = $row['name']; $username = $row['username']; $email = $row['email']; $DateOfBirth = $row['Date_of_birth']; $department = $row['department']; $age = …

Member Avatar
+0 forum 0

I have the following code where I can get the field names from a table in a select box. How can I display the contents of a field when it is selected. Thanks! <?php $host = 'localhost'; $port = '3306'; $server = $host . ':' . $port; $user = 'root'; $password = ''; $link = count($t_tmp = explode(':', $server)) > 1 ? mysqli_connect($t_tmp[0], $user, $password, '', $t_tmp[1]) : mysqli_connect($server, $user, $password); if (!$link) { die('Error: Could not connect: ' . mysqli_error($link)); } $database = 'mydb'; mysqli_select_db($link, $database); $query = 'select * from mytable'; $result = mysqli_query($link, $query); if (!$result) { …

Member Avatar
+0 forum 0

I'd like to get all of a mysql table's col names in a select box, and display the selected column name in a table. I just want to select one column at a time to display it in a single column table. I am assuming this can be done with a single query for all columns because they all will be displayed in the same table format. What I did so far is this: <html> <head> </head> <body> <table id="tbresult"> <tr> <th>Column</th> </tr> <?php include ("config.php"); $sql = "SHOW COLUMNS FROM mytable"; $result = mysqli_query($conn,$sql); while($row = mysqli_fetch_array($result)){ echo "<tr><td>" …

Member Avatar
+0 forum 0

Hi This question or similar were 4 years ago has already been asked but in my situation did not help. I have codeigniter project. in my employee database I have TINYINT field status. if 1 employee is active otherwise inactive. my form is in bootstrap modal. here is switch button code: <div class="onoffswitch3"> <input type="checkbox" name="status" class="onoffswitch3-checkbox" id="myonoffswitch3" data-format="Y-m-d" required > <label class="onoffswitch3-label" for="myonoffswitch3"> <span class="onoffswitch3-inner"> <span class="onoffswitch3-active"><span class="onoffswitch3-switch" id="onoffswitch3-switch">Active</span></span> <span class="onoffswitch3-inactive"><span class="onoffswitch3-switch" id="onoffswitch3-switch">Inactive</span></span> </span> </label> </div> question is how can I get value of switch either it is 1 or 0. ( on form when I am clicking switch …

Member Avatar
+0 forum 0

Greetings to everyone, I am working as a freelance web developer, i have more than 4 years experience in osclass scripts. I am working in the osclass scripts for the past 4 years and have created nearly 67 sites in osclass, and have created many plugins, cuztomized themes, plugin cuztomizations according to the clients need. I saw many of the post was unanswered here regarding the osclass scripts, so i make this new topic those who are wandering for a good programmer for their osclass script, reply me here if you need my support, thanks.

Member Avatar
+0 forum 0

Hello! I'm learning to program. I'm watching courses on how to create blogs in "laravel". I created an admin panel with the function of adding the article "form html". it is: title, description, text field - name is "section" I would like to add a button to add another "section". after clicking "add" will appear again: title, description, text field. after adding a few sections and publishing the article, each section would be a separate "row" with a class of 100% to be visible on the whole page. moving the mouse would move to the next section. unfortunately I do …

Member Avatar
+0 forum 0

I have two values in my code one is from a SQL Server query echo to the screen as formattedNum10d my second value is stored in a MySQL database and echo to the screen as formattedNum10f. In a seperate column i would like to subtract foramattedNum10f from formattedNum10d and echo the result but everything i have tried does not work any help would be greatly appreciated. $sql10d="SELECT SUM (CASE WHEN FFP.SINVOICE.NUM_0 Like '%SCR%' THEN (0 - (FFP.SINVOICE.AMTATIL_0 - FFP.SINVOICE.AMTTAX_0)) ELSE (FFP.SINVOICE.AMTATIL_0-FFP.SINVOICE.AMTTAX_0) END) FROM FFP.BPCUSTOMER, FFP.SINVOICE INNER JOIN FFP.SINVOICEV ON FFP.SINVOICE.NUM_0 = FFP.SINVOICEV.NUM_0 WHERE FFP.SINVOICEV.PJT_0='' AND FFP.SINVOICE.BPR_0 = FFP.BPCUSTOMER.BPCNUM_0 AND ((FFP.SINVOICE.ACCDAT_0>='$day01')) …

Member Avatar
+0 forum 0

> this is php code for get value while ($row = $activeRiders->fetch(PDO::FETCH_ASSOC)){ $rider_name = $row['RiderName']; $longitude = $row['CurrentLongitude']; $latitude = $row['CurrentLatitude']; $locations[]=array( $rider_name, $latitude, $longitude ); } $markers = json_encode( $locations ); > Jquery function $(document).ready(function() { $('#map').height($('.page-container').height()); $( window ).resize(function() { $('#map').height($('.page-container').height()); }); <?php echo "var markers=$markers;\n"; ?> > Initialize Map map = new GMaps({ el: '#map', lat: 24.8615, lng: 67.0099, zoom: 12, zoomControl : true, zoomControlOpt: { style : 'SMALL', position: 'TOP_LEFT' }, circleOptions: { fillColor: '#ffff00', fillOpacity: 1, strokeWeight: 5, clickable: false, editable: true, zIndex: 1 }, panControl : false, streetViewControl : false, mapTypeControl: false, overviewMapControl: false, …

Member Avatar
+0 forum 0

The End.