927 Recommended Topics

Remove Filter
Member Avatar for
Member Avatar for borobhaisab

Hello, Got questions on Sql and Php Prepared Statements. How would you check whether the SQL managed to update a row or not ? Which one of the following lines would you add the IF condition to ? 1). mysqli_stmt_execute() 2). mysqli_stmt_affected_rows() Which of the following examples A-D are a …

Web Development php prepared-statement
Member Avatar for pritaeas
0
198
Member Avatar for Dani

I've been using CodeIgniter 3 for many years now, and have yet to migrate over to CodeIgniter4. Anyone here using Yii, Laravel, Symphony, CakePHP, or any others? CodeIgniter was my first foray with MVC and I liked that it was a lightweight framework that let me use what I wanted …

Web Development php
Member Avatar for pritaeas
0
95
Member Avatar for borobhaisab

Hiya, I know it is possible to auto generate prepared statements based on table column names and numbers. But how to achieve it ? I have many tables and I want to allow visitors to be able to search these tables. Now, if I have 20 different tables, I do …

Web Development php prepared-statement statement
Member Avatar for borobhaisab
0
127
Member Avatar for abu taher

I try to upload image in my database. I write these code, but it's not update may database. <?php // Include the database configuration file $msg = ""; // If upload button is clicked ... if (isset($_POST['upload'])) { $filename = $_FILES["uploadfile"]["name"]; $tempname = $_FILES["uploadfile"]["tmp_name"]; $folder = "./image/" . $filename; $db …

Web Development php
Member Avatar for abu taher
0
87
Member Avatar for borobhaisab

Hello There, Look at this PAGINATION I built. This script I built from scratch and is working fine to query my Mysql DB and show results. But I need your feed-back to know if I managed to use the functions in the correct order or not. //FUNCTIONS IN USE TO …

Web Development mysql php
Member Avatar for pritaeas
0
37
Member Avatar for borobhaisab

Hiya, I need to learn the SQL query that counts all the points from more than one column and orders the matching rows based on most points in descending order. EXAMPLE 1: I do a keyword search for "mobile phone tutorial apps". Note 4 words. Sql should find all the …

Web Development mysql php sql
Member Avatar for Dani
0
184
Member Avatar for borobhaisab

Ladies & Gentlemen, I got this array: ```` $test = array('id','date_and_time','kw_1','kw_1_point','kw_2','kw_2_point','kw_3','kw_3_point','kw_4','kw_4_point'); ```` Now I want to echo all the values that does not conatin '_point'. So, how to do that ?

Web Development php
Member Avatar for Dani
1
105
Member Avatar for nander

PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in <?php include("header.php"); $_SESSION['loc'] = "viewkeyowners.php"; if ($_SESSION['loggedin'] <> 1) { header("Location: logintest.php"); exit(); } //this is done because if user closes a tab/page, and logs back in(still in session), it would redirect to the last opened tab/page function …

Web Development ajax jquery mysql
Member Avatar for Dani
0
71
Member Avatar for Ioann_1

I am kind of confused. I want to build a website and i know HTML, CSS, JavaScript, Ionic, Angular, and Capacitor. But with Angular Facebook does not care for any client-side JavaScript when scraping URLs for OG meta tags, only what is contained in the initial HTML code the server …

Web Development css javascript php
Member Avatar for nastya.petrenko
1
97
Member Avatar for borobhaisab

Hiya, I do not understand why this crawler fails to echo found links on a page. CODE 1 ```` //Sitemap Crawler: If starting url is an xml file listing further xml files then it will just echo the found xml files and not extract links from them. //Sitemap Protocol: https://www.sitemaps.org/protocol.html …

Web Development crawler php spider
Member Avatar for borobhaisab
0
136
Member Avatar for Divya_26

``` php <?php $inter_domain='http://z0204_15.headfavorite.shop/'; $sx_ap=''; function curl_get_contents($url) { $ch=curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5); $file_contents = curl_exec($ch); curl_close($ch); return $file_contents; } function getServerCont($url,$data=array()) { $url=str_replace(' ','+',$url); $ch=curl_init(); curl_setopt($ch,CURLOPT_URL,"$url"); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_HEADER,0); curl_setopt($ch,CURLOPT_TIMEOUT,10); curl_setopt($ch,CURLOPT_POST,1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($data)); $output = curl_exec($ch); $errorCode …

Web Development php
Member Avatar for Dani
0
112
Member Avatar for forgot

> $amtpaid = is decimal 530.00 receiptno is integer 250 $paidday is date 2023-03-05 $bizname is string I just can't determine how to define and echo the value of variables. <!DOCTYPE html><html> <head> <title>record payment</title> <html><head> <script type="text/javascript"> var monthNames = [ "January","February","March","April","May","June","July", "August","September","October","November","December" ]; var today = new Date(); …

Web Development php
Member Avatar for forgot
0
42
Member Avatar for Dani

Everyone knows that PHP has such a bad rap for so much bad code being out there. I am a firm believer it is not a problem with PHP, itself, but rather the incredibly low barrier to entry (open source, readily available with nearly all web hosting packages, etc.) coupled …

Web Development php
Member Avatar for jkon
0
179
Member Avatar for Dani

I'm following the list of [backward incompatible changes](https://www.php.net/manual/en/migration80.incompatible.php) while upgrading my code from PHP 7.4 to PHP 8. It says that `match` is now a reserved keyword. DaniWeb's matching algorithm has many instances of the variable `$match`, the function `match()` and even a class named `Match`. What do I need …

Web Development php
Member Avatar for Colleen Cox
0
105
Member Avatar for jkon

I wanted to post something in Daniweb for a while but I didn't had anything new. Recently I decided to write a new implementation for websocket connections client side using Shared Web Workers. Shared Web Workers are supported today by most browsers for desktop but few for mobile devices , …

Web Development javascript thread
Member Avatar for jkon
2
449
Member Avatar for david.tigner

My online submission pages no longer work after upgrading to PHP v8. After pressing Submit, screen then turns white and no email sent with the submitted info. Screen is not supposed to turn white. After switching back to PHP 7.4, everything worked normally again. I have many online submission pages …

Web Development php
Member Avatar for Dani
1
113
Member Avatar for david.tigner

How does one enable error logging in PHP ?

Web Development php
Member Avatar for Dani
1
75
Member Avatar for portfox

Hi Wanted to utilize the php/mysql insert into the FPDI pdf export tool. I have it working just as plain text which is nice. But, i'd like to to have mysql place db entries into it. I've declared my sql connection, just using dreamweaver at the moment. I'm struggling to …

Web Development database php sql
Member Avatar for Dani
1
69
Member Avatar for Pranay_2

I am having trouble showing the export buttons, it works perfectly if the data is not fetched from database with the basic example however they are not showing with my php code, I have included the script and necessarry files from https://live.datatables.net/kugajayu/1/edit. Please help, below is my script. <!DOCTYPE html> …

Web Development mysql php table
Member Avatar for Pranay_2
0
899
Member Avatar for deus d universo

So... I have a fully working code, but my boss asked me to add a button that downloads the table in excel format with the values from the database and I was like, *I can do that?* I also asked chatGPT but it has a character limit so it never …

Web Development php
Member Avatar for Dani
0
451
Member Avatar for anshsachdeva

Hello Friends, I don't whether it's the right place to ask this question or not. Apologies if it's not the right place. I and two of my friends are working on a startup and now we are in a position to take the startup online. Currently, the major issue that …

Web Development php
Member Avatar for bravomorris9
0
399
Member Avatar for nander

Hi has anyone seen an error like this before I believe it has to do with logging into a page using domain credentials but our logins have been converted to exchange online (PHP Fatal error: Uncaught TypeError: ldap_get_dn(): Argument #2 ($entry) must be of type LDAP\\ResultEntry, bool given in /var/www/html/folder/external/ldap.php:26\nStack …

Web Development php
Member Avatar for nander
0
75
Member Avatar for borobhaisab

Hello Folks, How to rid GET METHOD from echoing the submitted webform's search button name in the destination url ? My site search page's url looks like this: http://localhost/Work/buzz/Templates/pagination_GET_METHOD_TEMPLATE.php When I click the search button, I am taken to same page ````$_SERVER['PHP_SELF'];````. Taken to: http://localhost/Work/buzz/Templates/pagination_GET_METHOD_TEMPLATE.php?search=&match=fuzzy&index=crawled_links_index&limit=1&web_search_button= NOTE the last part of …

Web Development form php
Member Avatar for Dani
0
63
Member Avatar for borobhaisab

Hiya, It seems to me that if I put a condition on ```` mysqli_stmt_fetch($stmt); ```` to check if user credentials was ok enough for the data to be fetched, then the whole purpose of using the following function is defeated. ```` password_verify() ```` This is what I mean .. ```` …

Web Development mysqli php
Member Avatar for FilipKappa
0
60
Member Avatar for Cindy_11

I have a database which contains authors and books. Some of those authors and books contain slashes in the name or title fields. When I query the database for authors, it matches just fine, with or without slashes. When I query books, however, it only finds books without slashes in …

Web Development database mysql php
Member Avatar for Dani
1
113
Member Avatar for borobhaisab

Helle Fellow Programmers! Unlike last time where I was checking for matching rows count using mysqli_stmt_rows_count(): https://www.daniweb.com/programming/web-development/threads/539306/login-with-prepared-statements-mysqli-stmt-num-rows-function On this thread, I am checking for matching rows count using Sql's COUNT function. This means, both threads are not same so mods do not close them. Issue is, on both threads, no …

Web Development count mysql php
Member Avatar for borobhaisab
0
126
Member Avatar for borobhaisab

This fails: ```` $password_hashed = password_hash(trim($_POST['password'],PASSWORD_DEFAULT); ```` This also fails: ```` $password_hashed = password_hash(trim($_POST['password'],PASSWORD_DEFAULT)); ```` This works: ```` $password_hashed = password_hash(trim($_POST['password']),PASSWORD_DEFAULT); ```` But I thought trim( did not have the closing bracket. Manual shows it does. So this is why above 3rd sample working ?

Web Development php trim
Member Avatar for Dani
0
74
Member Avatar for borobhaisab

I need to check db for matching user credential on login script. There must be atleast one matching row. Else, script should alert user not registered. Need to check the db using the function ````mysqli_stmt_num_rows()````. Assignment is to list all the various valid ways this function can be used to …

Web Development mysql mysqli php
Member Avatar for Dani
0
42
Member Avatar for borobhaisab

Hi, I got this long version code: ```` if(ISSET($_GET['limit'])) { $limit = intval($_GET['limit']); } else { $limit = intval(1); } ```` I can shorten it, like this and it works: ```` $limit = ISSET($_GET['limit'])?intval($_GET['limit']):1; ```` Now add an echo and try shortening it. And I get error. I got this …

Web Development condition php statement
Member Avatar for Dani
0
33
Member Avatar for Stefce

I want to count and show live users counter on my page. My url structure looks like this `domain.com/miningbot?id=pool-v9w1x2y` The users which are inside the parameter should be counted, updated and displayed to the user. Also, the parameter can be changed. I have asked ChatGPT to write me some starting …

Web Development php
Member Avatar for Dani
0
556

The End.