PHP: How to get the total number of data in the MySQL table (total number of rows)

RewCount (): Returns the number of rows affected:

 $sql='select * from '.$_POST['fname'].'_blog_data';
		 $sth=$pdo->query($sql);
		 die('<script>alert('.$sth->rowCount().')</script>');

2

$q = $pdo->query("SELECT count(*) from w_login_record;"); $rows = $q->fetch(); $rowCount = $rows[0];
		 die('alter("'.$rowCount.'")');

3

Use the fetchAll function $q = $db->query("SELECT ..."); $rows = $q->fetchAll(); $rowCount = count($rows);

ValueError: need more than 1 value to unpack

class Person():

def __init__(self, Newname, Newage, Newtype):

self. type = Newtype,self.name = Newname,self. age = Newage,

This is the wrong way to write, not on the same line!

#     def __init__(self, Newname,Newage,Newtype):

#         self.name = Newname,

#         self. age = Newage,

#         self. type = Newtype,

from django. http import  HttpResponse
from django. template import Template ,Context
import datetime
from HelloDjango.Model. Person import *

def Hello(request , offset ):

tempStr = “{{person.name}} {{person. age}} {{person. type}}”
tempAnswer = {“person” : Person(“hjc”, “11”, “man”)}
#
#     tempStr = “{{person.name}} {{person. age}} {{person. type}}”
#     tempAnswer = {“person” : Person(‘hjc’ , ’11’ ,’man’)}

t = Template(tempStr)
c = Context(tempAnswer)
return HttpResponse(t.render(c))

Flutter Xcode Module not found or LibreSSL SSL_connect: SSL_ERROR_SYSCALL

Xcode appears in the Flutter project

The Module ‘qr_code_scanner’ not found

or

LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

~/. GitConfig file
can be edited to modify or add proxies, requiring local hanging ladder

[http]
    sslBackend = openssl
    proxy = socks5://127.0.0.1:7890

How to Set latex text Bold & Italic

Show upright text: \textup{text}
italic: \textit{text}
slanted italic: \textsl{text}
Display lowercase uppercase text: \textsc{text}
Medium weight: \textmd{text}
Bold command: \textbf{text}
Default value: \textnormal{text}

Italic: \textit{italic}, or \emph{italic}

Fine font: \textlf{light font}

Use equal-width fonts: \texttt{code}

Use sans-serif font: \textsf{sans-serif}

All letters uppercase: \uppercase{CAPITALS}

All letters uppercase, but lowercase letters are smaller: \textsc{Small Capitals}

How to Hide index.php

 
 

 
 
 

server {
        listen        80;
        server_name  www.mxscs.com;
        root   "D:/develop_soft/daima_mxs/ib_crm_bonus";
        location/{
           if (!-e $request_filename) {  
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            }
            index index.php index.html error/index.html;
            error_page 400 /error/400.html;
            error_page 403 /error/403.html;
            error_page 404 /error/404.html;
            error_page 500 /error/500.html;
            error_page 501 /error/501.html;
            error_page 502 /error/502.html;
            error_page 503 /error/503.html;
            error_page 504 /error/504.html;
            error_page 505 /error/505.html;
            error_page 506 /error/506.html;
            error_page 507 /error/507.html;
            error_page 509 /error/509.html;
            error_page 510 /error/510.html;
            include D:/develop_soft/daima_mxs/ib_crm_bonus/nginx.htaccess;
            autoindex  off;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

 

No artifacts package solution for idea to configure Tomcat

I don’t know why my idea is always inexplicably wrong, maybe it is aimed at me
1. At this point you can see that there are no artifacts and there are warnings in the bottom that cause Tomcat to not be successfully configured

2. The solution I found on the Internet is to check this box, but my default is that the box does not solve my problem
 

3. I updated the Maven environment and solved it successfully

Conclusion: Just update the Maven environment
 

The reason and solution of the error of join function: sequence item 0: expected STR instance, int found

When I was writing code the other day, the task was to separate the incoming parameters with “_” and then append them to the file
Direct up code

def operate(file_path, *args):
    f = open(file_path, mode="a", encoding="utf-8")
    s = ""
    s = '_'.join(args)
    f.write(s)
    f.flush()
    f.close()
operate("hhhh.txt", 123, 456, 789)

Receive a string, but I wrote a number by mistake, then reported an error
TypeError: sequence item 0: expected STR instance, int found TypeError: sequence item 0: expected STR instance, int found TypeError: sequence item 0: expected STR instance, int found
Then look for the document, and here’s the original text
Return a string which is the concatenation of the strings in iterable. A TypeError will be raised if there are any non-string values in iterable, including bytes objects. The separator between elements is the string providing this method.
The join function is a string function, and the arguments and inserts are strings
So:
S = ‘_’.join(args) to

s = '_'.join(str(args).strip())

That’s it!
 
 
 

Type error: sequence item 0: expected STR instance, int found

TypeError: sequence item 0: expected STR instance, int found TypeError: sequence item 0: expected STR instance, int found
List1 =[1,’two’,’three’,4]
print(‘ ‘.join(list1))
I thought it would print 1, two, three, four
The result was an error
Traceback (most recent call last):
File “< pyshell#27>” , line 1, in < module>
print(” “.join(list1))
peerror: sequence item 0: expected STR instance, int found
p> (“.join(list1))
TypeError: sequence item 0: expected STR instance, int found
A list of numbers cannot be converted directly to a string.
Print (” “.join(‘%s’ %id for id in list1))
That is, iterating through the elements of the list, converting them to strings. So I can print 1, 2, 3, 4.

AES CBC PKCs × 7 encryption

Performing encryption behind Java. Security. InvalidKeyException: illegal Key Size
Because the key is more than 128, sell Java. Security. InvalidKeyException: Illegal key size. Because the key length is limited, the Java runtime environment reads restricted policy files.
solution :
lution A:
g> the official download of the JCE unrestricted permission policy file, and replace the corresponding file
JDK7 download address: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
JDK8 download address: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
Download after decompression can see local_policy. Jar and US_export_policy jar and readme. TXT
if installed JRE, put the two jar files in % JRE_HOME % \ lib \ security directory under the cover of the original file
if installed JDK, and put the two jar files are in % JDK_HOME % \ JRE \ lib \ security directory to cover the original file
Option B:
Replace Oracle JDK with OpenJDK, the free and open source Java version of Oracle. OpenJDK does not have this limitation, and most Java services run on the OpenJDK environment