Mysql建表显示错误,Error : You have an error in your SQL syntax;(急!!!)

create TABLE ProductIns
(product_id char(4) NOT FULL,
product_name VARCHAR(100) NOT FULL,
product_type varchar(32) NOT FULL,
sale_price INTEGER DEFAULT 0,
purchase_price INTEGER ,
regist_date INTEGER ,
PRIMARY KEY (product_id));

在mysql创建上面这么一个表格显示错误:
Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULL,
product_name VARCHAR(100) NOT FULL,
product_type varchar(32) NOT ' at line 2

请问问题是出在哪里了

1个回答

约束条件拼写错误,是NOT NULL,不是NOT FULL。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
SQL嵌套查询语句的报错问题

String sql = "select * from msgInfo where ID in(select top 15 ID from msgInfo where chatRoom=? Order by chatTime DESC) order by chatTime"; String userName=session.getAttribute("_USER").toString(); PreparedStatement ps = conn.preparedStatement(sql); ps.setString(1,session.getAttribute("_CHAT_ROOM").toString()); ResultSet rs = conn.executeQuery(); 这语句有问题吗,怎么老报错,没道理啊 ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '15 ID from msgInfo where chatRoom='dragon inn' Order by chatTime DESC) order by ' at line 1 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '15 ID from msgInfo where chatRoom='dragon inn' Order by chatTime DESC) order by ' at line 1

怎么解决 you must be root to run this script,please use root to install lnmp

怎么解决 linux下的 you must be root to run this script,please use root to install lnmp

启动报错 报mysql的错误大家给看下

这个数据库是oracle从mysql迁过来的 表和视图都没有丢失 ``` 严重: Servlet.service() for servlet default threw exception com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION salestest.to_date does not exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) at com.mysql.jdbc.Util.getInstance(Util.java:360) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:978) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887) ```

如何将像“exampletablename”这样的TABLE名称更改为“$ exampletablename”

<div class="post-text" itemprop="text"> <p>How to make this code working? I have the code:</p> <pre><code>$tablename = $user_data['id']; $sql= "CREATE TABLE ".$tablename." ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, YO VARCHAR(30) NOT NULL, DESTINATARIO VARCHAR(30) NOT NULL, MENSAJE VARCHAR(100), reg_date TIMESTAMP )"; </code></pre> <p>I wana create a TABLE for every client, and i whant the id to be the table name.<br> The problem is that every time i use $tablename as a table name, like in the example, i got this error:</p> <p><em>"Error creating table: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"35599"</em>".</p> <p>If I change the $tablename with a value like "35599" for example, is creating the table perfectly. Any one knows how to use a the "$tablename" on the sql request?</p> </div>

mysql 5.6 版本的程序跑mysql 8.0 报错如下 ,数据库可以正常连接,连接数据库的驱动等相关jar 也换成了mysql8.0对应版本还是报如下错误

[http-nio-8085-exec-3] INFO com.gdk.jdbc.connection.ConnectionPoolManager - ***** Add ConnectionPoolShutdownHook to JVM hook ***** [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging. [http-nio-8085-exec-3] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5 [built 02-January-2015 13:25:04 -0500; debug? true; trace: 10] [http-nio-8085-exec-3] WARN com.mchange.v2.c3p0.cfg.C3P0Config - named-config with name 'mysql' does not exist. Using default-config. [http-nio-8085-exec-3] WARN com.mchange.v2.c3p0.cfg.C3P0Config - named-config with name 'mysql' does not exist. Using default-config extensions. [http-nio-8085-exec-3] INFO com.gdk.jdbc.connection.c3p0.C3P0ConnectionProvider - >>>>>> C3P0ConnectionProvider startup initing with configuration: {"file":"/E:/tomcat/webapps/huajiu/WEB-INF/classes/datasource.xml","id":"mysql.1509899288","name":"mysql","driverClass":"com.mysql.cj.jdbc.Driver","driverUrl":"jdbc:mysql://47.XXX.XXX.229:3306/huajiu?useSSL=true","user":"root","password":"******","connectionProvider":"com.gdk.jdbc.connection.c3p0.C3P0ConnectionProvider","dialect":"com.gdk.jdbc.dialect.MySQLDialect","maxConnectionSize":10,"minConnectionSize":1,"initConnectionSize":1,"availableConnectionSize":1,"acquireIncrementSize":1,"maxConnectionIdletime":3600,"maxConnectionLifetime":14400,"acquireRetryAttempts":30,"acquireRetryDelay":2000,"idleConnectionTestPeriod":3600,"testConnectionCheckout":false,"testConnectionCheckin":false,"connectionTimeout":5000,"showSQL":false,"loadOnStartup":true,"monitorEnable":false,"weight":1,"_xaDataSourceClass":"com.mysql.jdbc.jdbc2.optional.MysqlXADataSource","customize":{}} [http-nio-8085-exec-3] INFO com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 2000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> mysql.1509899288, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgf2m9a61o8yo2f6gh111|79cc61a8, idleConnectionTestPeriod -> 3600, initialPoolSize -> 1, jdbcUrl -> jdbc:mysql://47.XXX.XXX.229:3306/huajiu?useSSL=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 14400, maxIdleTime -> 3600, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 1, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ] com.gdk.jdbc.connection.ConnectFailedException: Can not get a Master Connection from datasource<mysql>! at com.gdk.jdbc.connection.ConnectionPoolManager.getMasterConnection(ConnectionPoolManager.java:188) at com.gdk.jdbc.JdbcHandlerImpl.getMasterConnection(JdbcHandlerImpl.java:1780) at com.gdk.jdbc.JdbcHandlerImpl.getConnection(JdbcHandlerImpl.java:1767) at com.gdk.jdbc.JdbcHandlerImpl.queryForList(JdbcHandlerImpl.java:1156) at com.gdk.jdbc.JdbcHandlerImpl.queryForList(JdbcHandlerImpl.java:1138) at com.qshl.aqb.sys.dao.PlatformDao.getUserByUname(PlatformDao.java:21) at com.qshl.aqb.sys.service.impl.PlatformServiceImpl.login(PlatformServiceImpl.java:26) at com.qshl.aqb.sys.controller.PlatformController.unameLogin(PlatformController.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1156) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@1c2032db -- timeout at awaitAvailable() at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1461) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:639) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:549) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at com.gdk.jdbc.connection.c3p0.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:230) at com.gdk.jdbc.connection.ConnectionPoolManager.getMasterConnection(ConnectionPoolManager.java:177) ... 49 more

转到-连接到外部mysql数据库

<div class="post-text" itemprop="text"> <p>I'm rather new to use go and am having issues connecting to an external mysql database. I'm using the go-sql-driver which seams rather nice. Suggestions to other drivers are welcomed! </p> <p>this is the whole program:</p> <pre><code>import ( "database/sql" _ "github.com/go-sql-driver/mysql" "fmt" ) const ( DB_HOST = "tcp(http://thedburl.com)" DB_NAME = "nameofdatabase" DB_USER = "username" DB_PW = "password" ) func main() { dsn := DB_USER + ":" + DB_PW + "@" + DB_HOST + "/" + DB_NAME + "?charset=uf8" db, err := sql.Open("mysql", dsn) if err != nil { fmt.Println("shiiet didn't work yo! Initialization failed") } defer db.Close() // go's purty cool var str string q := "SELECT * FROM forums" err = db.QueryRow(q).Scan(&amp;str) if err != nil { fmt.Println(err) } fmt.Println(str) } </code></pre> <p>On the request I'm recieving the following error</p> <pre><code> "GetAddrInfoW: The specified class was not found." </code></pre> <p>Any ideas? I've siting for hours on the webs, and can't seem to solve the problem. It might be worth noting that I have used the same database service many times in java.</p> </div>

旧的凌乱的PHP代码和MySQL注入[重复]

<div class="post-text" itemprop="text"> <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/60174/how-can-i-prevent-sql-injection-in-php" dir="ltr">How can I prevent SQL injection in PHP?</a> <span class="question-originals-answer-count"> 28 answers </span> </li> </ul> </div> <p>I have a small headache with an old project of mine. I wanted to put back online a legacy version of the website I once managed. The problem is, it was coded with PHP back in 1998+, at time when I had little to no knowledge about security issues (15yo taking first lessons in scripting stuff). When I examine the code now, I can see very little harm that can be possible done since most of the code does basic things without much tampering with vulnerable assets. With one exception, MySQL queries. I have literally thousands of selects, inserts and updates which are wide open for any MySQL injection attempt. The project was big, there are lots of files and lots of code. Even if I search and examine every occurence of mysql_query, I might still miss something. Lots of mess as well. Things like this are all over the place:</p> <pre><code> function Mess($ID) { $result = mysql_query("select * from table where `id` LIKE '$ID'"); } </code></pre> <p>I was thinking if would there be possibly some easy way to deal with that without spending hours and hours on examining every single MySQL query. Not to mention creating all the PDO structure and trying to intagrate it with this monstrosity. I'm just doing that in my spare time to honor the work lots of people devoted to creating content for this project years ago. So I was thinking about some sort of "general" solution. I was considering <strong>php prepend file</strong> but what could I possibly insert there to not cripple the incoming variables? I could just kill all GET,POST,COOKIE vars but this would prevent the website from providing content properly. I could disable all but SELECT access rights (I don't need more since this project is not ment to be updated) for the database user and then suppress error messages but that would still leave it open for injections, just without possibility to modify the database. Is someone aware of something I am not, something that would "overrule" the issue? I dont mind if someone will be able to tamper with the variable to view unitended content of that particular DB. There is nothing in that database which is private only (I deleted things like passwords, e-mails etc.). I do mind however the security and intergrity of other data stored on that host.</p> </div>

无法连接到IIS上的mySql

<div class="post-text" itemprop="text"> <p>So I need to do something for work which is to simply take a users name/last name/email and store it to a database.</p> <p>As a simple test, I put this in my connect file php:</p> <pre><code>$server="localhost"; $uname="root"; $pass="PASSHERE"; $db = "DBNAMEHERE"; $c2d = mysqli_connect($server, $uname, $pass, $db) or die("Failed to connect to database yo" . mysqli_error($c2d)); if($c2d){ echo "connection made"; }else{ echo "connection NOT made"; } </code></pre> <p>This above works when I run it from WAMP locally or from my test live server on Godaddy etc. Now, the issue is that the production environment is an IIS box to which I installed Apache on it via the IIS tool. It's my first time working with IIS so....Just trying to figure things out But need a bit of assistance</p> <p>For some reason, when I drag and drop the working file from my local machine to the production one for testing, the connection can never be made. It's always erroring out.</p> <p>I've done a bit of digging around but to no avail. I've tried different connection strings, ive tried messing with the PHP.ini file on the IIS box, ive tried other simple examples but again it always fails. After doing some research and reading random posts here on SO, I came across another post that essentially said to make sure that "mysqli" extension was enabled in php.ini and it is.</p> <p>Lastly, since i dont have a lot of time to get this working, I figured instead of saving to a database, id write locally to a file(csv and/or text file), with something like:</p> <pre><code>$putContentsIntoCSV = fopen("001registrations.csv", "a"); $putContentsIntoTXT = file_put_contents("001regtext.txt", $insertDataToText, FILE_APPEND); if($putContentsIntoCSV &amp;&amp; $putContentsIntoTXT ){ http_response_code(200); setcookie("success", true); echo "Your data has been saved!"; fputcsv($putContentsIntoCSV, $insertData); fclose($putContentsIntoCSV); }else{ http_response_code(400); echo "no connection"; } </code></pre> <p>and that too works in my local env. and my Godaddy server, but as soon as i drop it inside IIS/apache, it doesnt work. To be clear, PHP works, but the functionality im needing doesnt.</p> <p>Im pretty much stuck not sure what else to try. Any help is greatly appreciated.</p> </div>

PHP - where子句等于从URL中获取的2个值没有显示任何结果?

<div class="post-text" itemprop="text"> <p>I am trying to get the results for a specific race at a specific meet. </p> <pre><code>raceresult.php?meet=&lt;i&gt;August Meet&lt;/i&gt;&amp;race=&lt;i&gt;Allowance Fillies 2yo&lt;/i&gt; </code></pre> <p>The meet and race are showing up from the first query and some of the results show. For example:</p> <p>THIS ONE WORKS</p> <pre><code>raceresult.php?meet=meet=2013 OJCR Australian Derby&amp;race=Allowance - 9f on turf 3yo </code></pre> <p>DOES NOT WORK</p> <pre><code>raceresult.php?meet=2009 Gulfstream Park Grand Opening Meet&amp;race=Flying Stakes - Grade I, 3 yr old+, 8F on dirt </code></pre> <p>Are there any characters causing an error in the second example? I can go through and fix that issue pretty easily but I'm not really sure what is keeping that URL from working while the other one works great.</p> <p>My code is as follows. </p> <pre><code>&lt;?php $sql = "SELECT * FROM racing WHERE `meet` = '$meet' LIMIT 1"; $query = mysql_query($sql) or die( mysql_error() . "&lt;br /&gt;" . $sql ); while($row = mysql_fetch_array($query)){ $date= $row['date']; echo "&lt;h2&gt;&lt;strong&gt;$meet&lt;/strong&gt; ($date)&lt;/h2&gt;"; echo "&lt;b&gt;$race&lt;/b&gt;&lt;br&gt;"; } ?&gt; &lt;?php $sql = "SELECT * FROM racing WHERE `meet`='$meet' and `race`='$race' ORDER BY place"; $query = mysql_query($sql) or die( mysql_error() . "&lt;br /&gt;" . $sql ); while($row = mysql_fetch_array($query)){ $place= $row['place']; $horse= $row['horse']; $farm= $row['farm']; echo"$place. $horse owned by $farm"; } ?&gt; </code></pre> </div>

如何使用PHP从textarea向MySQL插入多个值和多行?

<div class="post-text" itemprop="text"> <p>Now i submit this to textarea :</p> <pre><code>1|Value </code></pre> <p>This insert to database :</p> <pre><code>------------------- Column1 | Column2 1 | Value ------------------- </code></pre> <p>Now I want to add these results to multiple lines by pressing the enter key, please help me add it This is my HTML index code :</p> <pre><code>&lt;form method="POST" action="add.php"&gt; &lt;div class="form-group"&gt; &lt;label for="chonphim"&gt;Film:&lt;/label&gt; &lt;select class="form-control" name="chonphim" id="chonphim"&gt; &lt;option value="kono-yo-no-hate-de-koi-wo-utau-shoujo-yu-no_JZ93Q"&gt;Phim Kono Yo no Hate de Koi wo Utau Shoujo YU-NO&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label for="player"&gt;Multiple row and data:&lt;/label&gt; &lt;textarea class="form-control" id="player" name="player" rows="4" placeholder="1|Value1 2|Value2 3|Value3"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;center&gt; &lt;div class="form-group"&gt; &lt;button style="margin-top: 15px;" class="btn btn-primary active" type="submit" &gt;Add value&lt;/button&gt;&lt;/div&gt;&lt;/center&gt; &lt;/form&gt; </code></pre> <p>This is add.php</p> <pre><code>$chonphim=$_POST['chonphims']; $player = escape_string($_POST['player']); $player1 = explode("|", $player); $tapphim = $player1[0]; $linkplayphim = $player1[1]; $sql2 = "UPDATE vohuunhan_film SET settime = settime + 1 WHERE link = '$chonphim'"; $sql88 = "INSERT INTO vohuunhan_episode (tap, linkplay, id_film) VALUES (N'$tapphim', N'$linkplayphim', N'$chonphim');"; if ($connect-&gt;query($sql88) === TRUE &amp;&amp; $connect-&gt;query($sql2) === TRUE) { echo "Success !"; } else { echo "Error: " . $connect-&gt;error; } </code></pre> <p>I want :</p> <pre><code>1|Value1 2|Value2 3|Value3 </code></pre> <p>Insert to database :</p> <pre><code>------------------- Column1 | Column2 1 | Value1 2 | Value2 3 | Value3 ------------------- </code></pre> </div>

如何通过PHP将DB上的值传递给JAVASCRIPT

<div class="post-text" itemprop="text"> <pre><code>&lt;?php // Connect to database server mysql_connect("192.168.1.101/phpmyadmin/", "root", "praticas") or die (mysql_error ()); // Select database mysql_select_db("logs_history") or die(mysql_error()); //---&gt; at this point, I want yo pull a VALUE from a column called potencia_ativa and insert in // the code JS below mysql_query($strSQL); // Close the database connection mysql_close(); ?&gt; //JS code------------------------------------------------------------------------------------------- &lt;div id="graphHolder" style="height:75%;width:100%"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; setInterval( function() { var d1 = []; for (var i = 0; i &lt; parseInt(document.getElementById('number').value,10); i += 0.5) { d1.push([ //----------&gt; pull the value from the php/DB as a FLOAT ]); } $.plot("#graphHolder", [{ label: "Label", data: d1, lines: { show: true, fill: true } } ]); }, 1000); &lt;/script&gt; </code></pre> </div>

选择'date1'和'date2'之间的mysql查询

<div class="post-text" itemprop="text"> <p>good afternoon, I have this code to query an INSERT made before to MySQL with date(); (just name, email, date) but, when I query the info back it returns nothing...</p> <p>This is the query page:</p> <pre><code>&lt;?php $con = mysqli_connect("localhost", "root", "", "registro"); if (mysqli_connect_errno()) { echo "Error al conectar a la BD"; } $fec1 = isset($_POST['fecha1']) ? $_POST['fecha1'] : NULL; $fec2 = isset($_POST['fecha2']) ? $_POST['fecha2'] : NULL; $nom = 'Nombre Completo'; $ema = 'Correo Electronico'; $fec = 'Fecha de Registro'; $result = mysqli_query($con, "select * from registro where date between '$fec1' and '$fec2'"); echo "&lt;table border='1'&gt;"; echo "&lt;tr&gt;"; echo "&lt;th&gt;".$nom."&lt;/th&gt;"; echo "&lt;th&gt;".$ema."&lt;/th&gt;"; echo "&lt;th&gt;".$fec."&lt;/th&gt;"; echo "&lt;/tr&gt;"; while ($row = mysqli_fetch_array($result)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;".$row['name']."&lt;/td&gt;"; echo "&lt;td&gt;".$row['email']."&lt;/td&gt;"; echo "&lt;td&gt;".$row['date']."&lt;/td&gt;"; echo "&lt;/tr&gt;"; } echo "&lt;/table&gt;"; ?&gt; </code></pre> <p>And this is the main page, wich inserts data on MySQL:</p> <pre><code>&lt;?php #error_reporting(0); $sqlhost = 'localhost'; $sqluser = 'root'; $sqlpass = ''; $sqldb = 'registro'; $sqltable= 'registro'; function captcha() { $k=""; $param="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $max=strlen($param)-1; for ($i=0; $i&lt;6; $i++) { $k.=$param{mt_rand(0,$max)}; } return $k; } $db = mysqli_connect($sqlhost, $sqluser, $sqlpass, $sqldb); //Nuestra variable para establecer la conexión a la base de datos if(!$db){die("Error al conectar con la db" . mysql_error());} $name = isset($_POST['name']) ? $_POST['name'] : NULL; // Tomamos el texto del input "nombre" $email = isset($_POST['email']) ? $_POST['email'] : NULL; // Tomamos el texto del input "apellido" $date = date('Y-m-d'); // Insertaremos la información a la tabla Nombre y Apellido, donde VALUES declara el texto que ingresaremos $query = "INSERT INTO ".$sqltable."(name, email, date) VALUES('".$name."', '".$email."', '".$date."');"; mysqli_select_db($db,$sqldb); //verificaremos la conexión a nuestra base de datos $insert_value = mysqli_query($db, $query); // Declaramos la variable $insert_value para usarla cómo un bool, en caso de que esta consulta falle if(!$insert_value) //Crearemos la consulta die('Error: ' . mysqli_error($db)); // Si falla, nos mostrará este texto, seguido del error. mysqli_close($db); // Detenemos la conexión de la base de datos ?&gt; </code></pre> <p>The <code>$fec1</code> and the <code>$fec2</code> variables, comes from php calendar and when I use that, it uses this format: </p> <pre><code>Fecha inicio: 1/11/2016 Fecha final: 7/11/2016 </code></pre> <p>I understand that MySQL stores date like this 'YYYY-mm-dd' I took a look to the calendar code but I can't query the results...</p> <p>This is the calendar code:</p> <pre><code>&lt;?php function calcula_numero_dia_semana($dia,$mes,$ano){ $numerodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano)); if ($numerodiasemana == 0) $numerodiasemana = 6; else $numerodiasemana--; return $numerodiasemana; } //funcion que devuelve el último día de un mes y año dados function ultimoDia($mes,$ano){ $ultimo_dia=28; while (checkdate($mes,$ultimo_dia + 1,$ano)){ $ultimo_dia++; } return $ultimo_dia; } function dame_nombre_mes($mes){ switch ($mes){ case 1: $nombre_mes="Enero"; break; case 2: $nombre_mes="Febrero"; break; case 3: $nombre_mes="Marzo"; break; case 4: $nombre_mes="Abril"; break; case 5: $nombre_mes="Mayo"; break; case 6: $nombre_mes="Junio"; break; case 7: $nombre_mes="Julio"; break; case 8: $nombre_mes="Agosto"; break; case 9: $nombre_mes="Septiembre"; break; case 10: $nombre_mes="Octubre"; break; case 11: $nombre_mes="Noviembre"; break; case 12: $nombre_mes="Diciembre"; break; } return $nombre_mes; } function dame_estilo($dia_imprimir){ global $mes,$ano,$dia_solo_hoy,$tiempo_actual; //dependiendo si el día es Hoy, Domigo o Cualquier otro, devuelvo un estilo if ($dia_solo_hoy == $dia_imprimir &amp;&amp; $mes==date("n", $tiempo_actual) &amp;&amp; $ano==date("Y", $tiempo_actual)){ //si es hoy $estilo = " class='hoy'"; }else{ $fecha=mktime(12,0,0,$mes,$dia_imprimir,$ano); if (date("w",$fecha)==0){ //si es domingo $estilo = " class='domingo'"; }else{ //si es cualquier dia $estilo = " class='diario'"; } } return $estilo; } function mostrar_calendario($mes,$ano){ global $parametros_formulario; //tomo el nombre del mes que hay que imprimir $nombre_mes = dame_nombre_mes($mes); //construyo la tabla general echo '&lt;table class="tablacalendario" cellspacing="3" cellpadding="2" border="0"&gt;'; echo '&lt;tr&gt;&lt;td colspan="7" class="tit"&gt;'; //tabla para mostrar el mes el año y los controles para pasar al mes anterior y siguiente echo '&lt;table width="100%" cellspacing="2" cellpadding="2" border="0"&gt;&lt;tr&gt;&lt;td class="messiguiente"&gt;'; //calculo el mes y ano del mes anterior $mes_anterior = $mes - 1; $ano_anterior = $ano; if ($mes_anterior==0){ $ano_anterior--; $mes_anterior=12; } echo "&lt;a href='index.php?$parametros_formulario&amp;nuevo_mes=$mes_anterior&amp;nuevo_ano=$ano_anterior'&gt;&lt;span&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;"; echo "&lt;td class='titmesano'&gt;$nombre_mes $ano&lt;/td&gt;"; echo "&lt;td class='mesanterior'&gt;"; //calculo el mes y ano del mes siguiente $mes_siguiente = $mes + 1; $ano_siguiente = $ano; if ($mes_siguiente==13){ $ano_siguiente++; $mes_siguiente=1; } echo "&lt;a href='index.php?$parametros_formulario&amp;nuevo_mes=$mes_siguiente&amp;nuevo_ano=$ano_siguiente'&gt;&lt;span&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;"; echo ' &lt;tr&gt; &lt;td width="14%" class="diasemana"&gt;L&lt;/td&gt; &lt;td width="14%" class="diasemana"&gt;M&lt;/td&gt; &lt;td width="14%" class="diasemana"&gt;X&lt;/td&gt; &lt;td width="14%" class="diasemana"&gt;J&lt;/td&gt; &lt;td width="14%" class="diasemana"&gt;V&lt;/td&gt; &lt;td width="14%" class="diasemana"&gt;S&lt;/td&gt; &lt;td width="14%" class="diasemana"&gt;D&lt;/td&gt; &lt;/tr&gt;'; //Variable para llevar la cuenta del dia actual $dia_actual = 1; //calculo el numero del dia de la semana del primer dia $numero_dia = calcula_numero_dia_semana(1,$mes,$ano); //echo "Numero del dia de demana del primer: $numero_dia &lt;br&gt;"; //calculo el último dia del mes $ultimo_dia = ultimoDia($mes,$ano); //escribo la primera fila de la semana echo "&lt;tr&gt;"; for ($i=0;$i&lt;7;$i++){ if ($i &lt; $numero_dia){ //si el dia de la semana i es menor que el numero del primer dia de la semana no pongo nada en la celda echo '&lt;td class="diainvalido"&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt;'; } else { echo "&lt;td " . dame_estilo($dia_actual) . "&gt;&lt;span&gt;&lt;a href='javascript:devuelveFecha($dia_actual,$mes,$ano)'&gt;$dia_actual&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;"; $dia_actual++; } } echo "&lt;/tr&gt;"; //recorro todos los demás días hasta el final del mes $numero_dia = 0; while ($dia_actual &lt;= $ultimo_dia){ //si estamos a principio de la semana escribo el &lt;TR&gt; if ($numero_dia == 0) echo "&lt;tr&gt;"; echo "&lt;td " . dame_estilo($dia_actual) . "&gt;&lt;span&gt;&lt;a href='javascript:devuelveFecha($dia_actual,$mes,$ano)'&gt;$dia_actual&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;"; $dia_actual++; $numero_dia++; //si es el uñtimo de la semana, me pongo al principio de la semana y escribo el &lt;/tr&gt; if ($numero_dia == 7){ $numero_dia = 0; echo "&lt;/tr&gt;"; } } //compruebo que celdas me faltan por escribir vacias de la última semana del mes if ($numero_dia != 0){ for ($i=$numero_dia;$i&lt;7;$i++){ echo '&lt;td class="diainvalido"&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt;'; } } echo "&lt;/tr&gt;"; echo "&lt;/table&gt;"; } function formularioCalendario($mes,$ano){ global $parametros_formulario; echo ' &lt;br&gt;&lt;form action="index.php?' . $parametros_formulario . '" method="POST"&gt; &lt;table align="center" cellspacing="2" cellpadding="2" border="0" class=tform&gt; &lt;tr&gt;'; echo ' &lt;td align="center" valign="top"&gt; Mes: &lt;br&gt; &lt;select name=nuevo_mes&gt; &lt;option value="1"'; if ($mes==1) echo "selected"; echo'&gt;Enero &lt;option value="2" '; if ($mes==2) echo "selected"; echo'&gt;Febrero &lt;option value="3" '; if ($mes==3) echo "selected"; echo'&gt;Marzo &lt;option value="4" '; if ($mes==4) echo "selected"; echo '&gt;Abril &lt;option value="5" '; if ($mes==5) echo "selected"; echo '&gt;Mayo &lt;option value="6" '; if ($mes==6) echo "selected"; echo '&gt;Junio &lt;option value="7" '; if ($mes==7) echo "selected"; echo '&gt;Julio &lt;option value="8" '; if ($mes==8) echo "selected"; echo '&gt;Agosto &lt;option value="9" '; if ($mes==9) echo "selected"; echo '&gt;Septiembre &lt;option value="10" '; if ($mes==10) echo "selected"; echo '&gt;Octubre &lt;option value="11" '; if ($mes==11) echo "selected"; echo '&gt;Noviembre &lt;option value="12" '; if ($mes==12) echo "selected"; echo '&gt;Diciembre &lt;/select&gt; &lt;/td&gt;'; echo ' &lt;td align="center" valign="top"&gt; A&amp;ntilde;o: &lt;br&gt; &lt;select name=nuevo_ano&gt;'; //este bucle se podría hacer dependiendo del número de año que se quiera mostrar //yo voy a mostar 10 años atrás y 10 adelante de la fecha mostrada en el calendario for ($anoactual=$ano-10; $anoactual&lt;=$ano+10; $anoactual++){ echo '&lt;option value="' . $anoactual . '" '; if ($ano==$anoactual) { echo "selected"; } echo '&gt;' . $anoactual . '&lt;/option&gt;'; } echo ' &lt;/select&gt; &lt;/td&gt;'; echo ' &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" align="center"&gt;&lt;input type="Submit" value="[ IR A ESE MES ]"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;br&gt; &lt;br&gt; &lt;/form&gt;'; } //////////////////////////////////////////////////////////////////////////////////////////////////////////// //Función que escribe en la página un fomrulario preparado para introducir una fecha y enlazado con el calendario para seleccionarla comodamente //////////////////////////////////////////////////////////////////////////////////////////////////////////// function escribe_formulario_fecha_vacio($nombrecampo,$nombreformulario){ //Esa variable $raiz sirve para cuando se llama al calendario desde otra ruta, para poder acceder a él global $raiz; //empieza en . termina en / echo ' &lt;INPUT name="'.$nombrecampo.'" size="10" class="inputfecha" onclick="muestraCalendario(\''. $raiz.'\',\''. $nombreformulario .'\',\''.$nombrecampo.'\')" onfocus="blur()"&gt; &lt;/div&gt; '; } ?&gt; </code></pre> <p>I appreciate any help and effort</p> </div>

移动没有保存在数据库中并在检索时生成2147483647 [重复]

<div class="post-text" itemprop="text"> <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/10255724/incorrect-integer-2147483647-is-inserted-into-mysql" dir="ltr">Incorrect Integer (2147483647) is inserted into MySQL?</a> <span class="question-originals-answer-count"> 10 answers </span> </li> </ul> </div> <p>Trying to get mobile no saved in the database with the following html5 validation and on every entry in db insted of the mobile no put 2147483647 gets saved.Please Help.Stuck</p> <pre><code>&lt;label for="su_mobile"&gt;Mobile No&lt;/label&gt; &lt;/span&gt; &lt;input type="tel" id="su_mobile" name="su_mobile" pattern="^[789]\d{9}$" title='Phone Number (Format:10 digits starting with 9/8/7 )' placeholder="No which you wanna get recharged" required&gt;&lt;/input&gt;&lt;br/&gt;&lt;br/&gt; $yo_mobile=@mysqli_real_escape_string($dbc, trim($_POST['su_mobile'])); &lt;label for="fi_mob"&gt;Mobile No&lt;/label&gt; &lt;br/&gt; &lt;input type="text" id="fi_mob" name="fi_mob" value="&lt;?php $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die('Error communicating to MySQL server.'); $cool=$_SESSION['user_id']; $a="SELECT * FROM userdata WHERE user_id='$cool'"; $name = mysqli_query($dbc,$a); while($row = mysqli_fetch_array($name)) { $queried_name = $row['mobile']; echo $queried_name; } mysqli_close($dbc); ?&gt;" readonly&gt;&lt;/input&gt;&lt;br/&gt; </code></pre> </div>

如何使用PHP跟踪gmail中的电子邮件

<div class="post-text" itemprop="text"> <p>Hi I built an email tracker and it works fine except on Gmail</p> <p>IMG CODE on HTML email sent</p> <p></p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>$track_code = md5(rand()); &lt;img src="https://www.syste-mart.com/tracker.php?code='.$track_code.'" width="1" height="1" title="Syste-mart"&gt;</code></pre> </div> </div> <p>tracker.php</p> <p></p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php include "conexion.php"; $db = mysql_connect($host,$username,$passwordDB); mysql_select_db($database,$db); mysql_query("SET CHARACTER SET utf8", $db); mysql_query("SET NAMES 'utf8'", $db); mysql_query("SET character_set_client=utf8", $db); mysql_query("SET character_set_connection=utf8", $db); mysql_query("SET character_set_results=utf8", $db); mb_language('uni'); mb_internal_encoding('UTF-8'); $code=$_GET['code']; $ipAddress = $_SERVER['REMOTE_ADDR']; $fecha=date("Y-m-d"); $hora=date("H:i:s"); if($code!=0){ //This will insert a row each time the email is opened $inserTrack=mysql_query("INSERT INTO emailTrack (idEmailTrack, track_code, ip, fecha, hora) VALUES ('', '$code', '$ipAddress', '$fecha', '$hora')", $db); } echo "&lt;img src='https://syste-mart.com/images/mail.png' width='30' height='30'&gt;"; ?&gt;</code></pre> </div> </div> <p>The error I get in gmail is: The requested URL /proxy/SZKsK8dZS1ZgM4QsOMe78tbq5Pz-2eT5G7rdKoBw6onZwoDU0hOZ4J2qxO06uuEAjh479rICREC3e2PZkbx9yLEAq4RosKVG255lDwkcLYwRgrArBkCJeW1YLYja-v8DKtHoRfh2o1S7TG01eSbhdDEocSDGRSn11SA75z2WzOdMl7XYDB_p3Mywx1xNjzc_4kugvMgKu3-AR9wVRgryZ3Yo4cYanTzENcjf=s0-d-e1-ft was not found on this server</p> <p>Any ideas? Thanks</p> </div>

Php上传文件如果无效则设置其他值而不是随机字

<div class="post-text" itemprop="text"> <p>This script is working fine.. but i just wonder how do i change the value insert into database if no image selected to value <strong>"none"</strong> instead of <strong>random words</strong> like <strong>15199660151398490708</strong> <br></p> <pre><code>&lt;?php $name = ''; $type = ''; $size = ''; $error = ''; $upload = "asssets/img/"; $new = time().rand(); $target = $upload . $new . basename( $_FILES['photo']['name']); require_once('includes/config.php'); // If form submitted, insert values into the database. if(isset($_POST['submit']) &amp;&amp; !empty($_POST['submit'])) { $pic=$new .($_FILES['photo']['name']); $query = "INSERT INTO posting(photo) VALUES('$pic')"; $result = mysql_query($query); //Writes the photo to the server if (($_FILES["photo"]["type"] == "image/gif") || ($_FILES["photo"]["type"] == "image/jpeg") || ($_FILES["photo"]["type"] == "image/png") || ($_FILES["photo"]["type"] == "image/pjpeg")) { $filename = compress_image($_FILES["photo"]["tmp_name"], $target, 80); { echo ""; } }else echo "";{ ?&gt;&lt;form method="post" style="padding:0px;margin:0px;display: block;" enctype="multipart/form-data" autocomplete="off"&gt; &lt;input name="photo" type="file" accept="image/*"&gt; &lt;input name="submit" class="button_post" id="click" type="submit" value=" Post" /&gt; &lt;/form&gt;&lt;?php } ?&gt; </code></pre> <p><a href="https://i.stack.imgur.com/MQ5yO.jpg" rel="nofollow noreferrer">This is example image mysql phpmyadmin</a></p> </div>

关于复选框值的javascript警报

<div class="post-text" itemprop="text"> <p>I have checkboxes whose value attribute is coming from database.I want the user to always check the checkboxes having same value if he does not then alert using javascript.I tried to do this using the following javascript code but no use</p> <pre><code>&lt;script&gt; function ck() { var x,item,f; list=document.getElementById("yo"); f=list[0].value; for(index=1;index&lt;list.length;++index) { item=list[index]; x=item.value; if(x!=f) { alert("Wrong type checkboxes selected!"); break; } } } &lt;/script&gt; </code></pre> <p>Below is the PHP code for checkbboxes</p> <pre><code>&lt;?php $flag1=-1; $conn = mysqli_connect("localhost", "root","","discvr"); if(! $conn ) { die('Could not connect: ' . mysql_error()); } for($i = 0; $i &lt; 150; $i++) { echo "&lt;tr&gt;"; $cur_date=date("Y-m-d"); echo "&lt;td&gt;Noida Sector ".($i+1)."&lt;/td&gt;"; $location="Noida Sector ".($i+1); for($j=1;$j&lt;=8;$j++) { $time_id=$j; $sql="select status from final where location = '$location' AND date='".$cur_date."' AND time_id=$time_id"; $query=mysqli_query($conn,$sql); if(!$query) { $status=0; echo "Hi"; } else { if($row=mysqli_fetch_array($query)) { //echo "hi"; $status=$row['status']; } else $status=0; //echo $time_id; } if($i==0) echo "&lt;td&gt;&lt;input type='checkbox' id='yo' name=time[] value=".$j." value='".$status."' onclick='ck()' &gt; $status &lt;/td&gt;"; else echo "&lt;td&gt;&lt;input type='checkbox' id='yo' name=time".$i."[] value=".$j." value='".$status."' onclick='ck()' &gt;$status&lt;/td&gt;"; } echo "&lt;/tr&gt;"; } ?&gt; </code></pre> </div>

如何将变量解析为header()页面

<div class="post-text" itemprop="text"> <p>I have this code on a page</p> <p>`</p> <pre><code> &lt;form method="post" action="" &gt; &lt;div id="search"&gt; &lt;form method="post" action="" &gt; &lt;input type="text" name="keywords" placeholder = "Try your luck"/&gt;&lt;input type="submit" value="Search" /&gt; &lt;/form&gt; &lt;?php if(isset($_POST['keywords'])){ $keywords = mysql_real_escape_string(htmlentities(trim($_POST['keywords']))); $errors = array(); if(empty($keywords)){ $errors[] = 'Please enter a search term'; } else if(strlen($keywords)&lt;3){ $errors[] = 'Your search term must be three or more characters'; } else if(search_results($keywords) === false){ $errors[] = 'Your search for '.$keywords.' returned no results'; } if(empty($errors)){ header ('Location: search-page.php'); } else{ foreach($errors as $error){ echo $error; } } } ?&gt; </code></pre> <p>The problem is that I want to youse the variable $keywords on the searchpage.php page. How can I acomplish that?</p> <p>EDIT: The code for search-page.php is :</p> <pre><code> &lt;?php include_once( 'headersearch.php' ); include ('includes/func.inc.php'); global $variable; ?&gt; &lt;table id="content-area"&gt; &lt;tr&gt; &lt;td id="search-page" valign="top"&gt; &lt;?php $results = search_results($keywords); $results_num = count($results); if($results_num == 1){ $s = "result"; } else{ $s = "results"; } echo '&lt;p&gt;Your Search for &lt;strong&gt;',$keywords,'&lt;/strong&gt; returned &lt;strong&gt;',$results_num,'&lt;/strong&gt; ',$s,'&lt;/p&gt;'; foreach($results as $results){ ?&gt; &lt;table id="posts"&gt; &lt;tr height="25px"&gt;&lt;td&gt;&lt;h1&gt;&lt;?php echo $results['article_title'] ; ?&gt;&lt;/h1&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;h2&gt;&lt;span&gt;Posted on&lt;/span&gt; :&lt;?php echo date('l jS',$results['article_timestamp']) ?&gt; &lt;span&gt;By&lt;/span&gt;: BMC &lt;/h2&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;h3&gt;&lt;?php echo substr($results['article_content'], 0, 300) ; ?&gt;[...]&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;a href="single.php?id=&lt;?php echo $results['article_id']; ?&gt;" title="TEST" class="button"&gt;Read Along&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;?php } ?&gt; &lt;?php include_once('sidebar.php'); ?&gt; &lt;/form&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php include_once( 'footer.php' ); ?&gt; </code></pre> <p>Please help me as fast as psible</p> </div>

制作代码点火器登记表[关闭]

<div class="post-text" itemprop="text"> <p>So I am making a form for people to register but its not working, and for some reason my debugger in netbeans is not working so I cannot check properly.</p> <p>This is the html form </p> <pre><code>&lt;?php if(validation_errors() != false) { echo '&lt;div class="form-group alert alert-danger alert-box has-error"&gt;'; echo'&lt;ul&gt;'; echo validation_errors('&lt;li class="control-label"&gt;', '&lt;/li&gt;'); echo'&lt;/ul&gt;'; echo '&lt;/div&gt;'; } /* form-horizontal */ echo form_open('main/insertInformation'); ?&gt; &lt;div class="form-group"&gt; &lt;input type="text" name="name" class="form-control input-lg" placeholder="Name"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input type="email" name="email" class="form-control input-lg" placeholder="Email"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input type="text" name="phone" class="form-control input-lg" placeholder="Phone"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input type="password" name="password" class="form-control input-lg" placeholder="Password"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;input type="password" name="password_confirm" class="form-control input-lg" placeholder="Confirm Password"&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;button type='submit' class="btn btn-primary btn-lg btn-block"&gt;Sign In&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Then I try to get all this information to my controller like this </p> <pre><code>public function insertInformation(){ $this-&gt;load-&gt;helper('form'); $this-&gt;load-&gt;library('form_validation'); $this-&gt;form_validation-&gt;set_rules('name', 'Name', 'required'); $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'required'); $this-&gt;form_validation-&gt;set_rules('phone', 'Phone', 'required'); $this-&gt;form_validation-&gt;set_rules('password', 'Password', 'required|min_length[4]|max_length[32]'); $this-&gt;form_validation-&gt;set_rules('password_confirm', 'Password Confirm', 'required|matches[password]'); if ($this-&gt;form_validation-&gt;run() == FALSE){ $this-&gt;load-&gt;view('header_view'); $this-&gt;load-&gt;view('login_view'); $this-&gt;load-&gt;view('footer_view'); }else{ $data = array( 'name' =&gt; $this-&gt;input-&gt;post('name'), 'email' =&gt; $this-&gt;input-&gt;post('email'), 'phone' =&gt; $this-&gt;input-&gt;post('phone'), 'password' =&gt; $this-&gt;input-&gt;post('password') ); $this-&gt;db-&gt;trans_begin(); $this-&gt;load-&gt;model('main_page'); $this-&gt;main_page-&gt;storeRegisterInfo($data); $message['account_created'] = 'Your account has been created'; $this-&gt;load-&gt;view('admin_view', $message); } } </code></pre> <p>And here is the model , </p> <pre><code>public function storeRegisterInfo($data){ $insert = $this-&gt;db-&gt;insert('new_users',$data); return $insert; } </code></pre> <p>and my database looks like this <a href="https://i.stack.imgur.com/RoRBO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RoRBO.png" alt="enter image description here"></a></p> <p>I am pretty new to codeigniter so I am pretty sure there is alot of errors here, so please do help me out and please do explain me in steps for a better understanding. Thanks!</p> <p>THis is the error <a href="https://i.stack.imgur.com/UT5yO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UT5yO.png" alt="enter image description here"></a></p> </div>

学Python后到底能干什么?网友:我太难了

感觉全世界营销文都在推Python,但是找不到工作的话,又有哪个机构会站出来给我推荐工作? 笔者冷静分析多方数据,想跟大家说:关于超越老牌霸主Java,过去几年间Python一直都被寄予厚望。但是事实是虽然上升趋势,但是国内环境下,一时间是无法马上就超越Java的,也可以换句话说:超越Java只是时间问题罢。 太嚣张了会Python的人!找工作拿高薪这么简单? https://edu....

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

为什么程序猿都不愿意去外包?

分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助

Java校招入职华为,半年后我跑路了

何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

@程序员:GitHub这个项目快薅羊毛

今天下午在朋友圈看到很多人都在发github的羊毛,一时没明白是怎么回事。 后来上百度搜索了一下,原来真有这回事,毕竟资源主义的羊毛不少啊,1000刀刷爆了朋友圈!不知道你们的朋友圈有没有看到类似的消息。 这到底是啥情况? 微软开发者平台GitHub 的一个区块链项目 Handshake ,搞了一个招募新会员的活动,面向GitHub 上前 25万名开发者派送 4,246.99 HNS币,大约价...

用python打开电脑摄像头,并把图像传回qq邮箱【Pyinstaller打包】

前言: 如何悄悄的打开朋友的摄像头,看看她最近过的怎么样,嘿嘿!这次让我带你们来实现这个功能。 注: 这个程序仅限在朋友之间开玩笑,别去搞什么违法的事情哦。 代码 发送邮件 使用python内置的email模块即可完成。导入相应的代码封装为一个send函数,顺便导入需要导入的包 注: 下面的代码有三处要修改的地方,两处写的qq邮箱地址,还有一处写的qq邮箱授权码,不知道qq邮箱授权码的可以去百度一...

做了5年运维,靠着这份监控知识体系,我从3K变成了40K

从来没讲过运维,因为我觉得运维这种东西不需要太多的知识面,然后我一个做了运维朋友告诉我大错特错,他就是从3K的运维一步步到40K的,甚至笑着说:我现在感觉自己什么都能做。 既然讲,就讲最重要的吧。 监控是整个运维乃至整个产品生命周期中最重要的一环,事前及时预警发现故障,事后提供详实的数据用于追查定位问题。目前业界有很多不错的开源产品可供选择。选择一款开源的监控系统,是一个省时省力、效率最高的方...

C++(继承):19---虚基类与虚继承(virtual)

一、菱形继承 在介绍虚继承之前介绍一下菱形继承 概念:A作为基类,B和C都继承与A。最后一个类D又继承于B和C,这样形式的继承称为菱形继承 菱形继承的缺点: 数据冗余:在D中会保存两份A的内容 访问不明确(二义性):因为D不知道是以B为中介去访问A还是以C为中介去访问A,因此在访问某些成员的时候会发生二义性 缺点的解决: 数据冗余:通过下面“虚继承”技术来解决(见下) 访问...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

win10暴力查看wifi密码

刚才邻居打了个电话说:喂小灰,你家wifi的密码是多少,我怎么连不上了。 我。。。 我也忘了哎,就找到了一个好办法,分享给大家: 第一种情况:已经连接上的wifi,怎么知道密码? 打开:控制面板\网络和 Internet\网络连接 然后右击wifi连接的无线网卡,选择状态 然后像下图一样: 第二种情况:前提是我不知道啊,但是我以前知道密码。 此时可以利用dos命令了 1、利用netsh wlan...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

女朋友过生日,我花了20分钟给她写了一个代理服务器

女朋友说:“看你最近挺辛苦的,我送你一个礼物吧。你看看想要什么,我来准备。” 我想了半天,从书到鞋子到电子产品最后到生活用品,感觉自己什么都不缺,然后和她说:“你省省钱吧,我什么都不需要。” 她坚持要送:“不行,你一定要说一个礼物,我想送你东西了。” 于是,我认真了起来,拿起手机,上淘宝逛了几分钟,但还是没能想出来缺点什么,最后实在没办法了:“这样吧,如果你实在想送东西,那你就写一个代理服务器吧”...

记一次腾讯面试,我挂在了最熟悉不过的队列上……

腾讯后台面试,面试官问:如何自己实现队列?

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

立即提问
相关内容推荐