我想在这里制作一个像这样的mysql插件
<http://www.w3schools.com/php/php_mysql_insert.asp >
INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)
Run Code Online (Sandbox Code Playgroud)
我试图将下面的值插入表userbase.
54007033331, Codi Y, Male, pub, http://google.com/ggg.jpg
INSERT INTO userbase (id,name,gender,publicity,pic) VALUES (54007033331, Codi Y, Male, pub, http://google.com/ggg.jpg)
MySQL query failed: 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 'Y, Male, pub, http://google.com/ggg.jpg)' at line 1
Run Code Online (Sandbox Code Playgroud)
任何人都可以指出我如何解决这种语法错误的正确方向?
我正在构建一个使用wifi的Android应用程序.
我在清单中正确声明了这些使用权限,但由于某种原因,应用程序抛出了一个SecurityException,导致应用程序强行关闭.
我将LogCat中安全异常的原因跟踪到系统,说它没有access_wifi_state权限.这对我来说很奇怪和困惑,因为我已经在清单中宣布了它.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.wifi"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="ACCESS_WIFI_STATE" />
<uses-permission android:name="CHANGE_WIFI_STATE" />
<uses-feature android:name="android.hardware.wifi" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="android.wifi.AndroidWiFiActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
以下是导致异常的代码:
package android.wifi;
import android.app.Activity;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.wifi.R;
public class AndroidWiFiActivity extends Activity {
/** Called when the activity is first …Run Code Online (Sandbox Code Playgroud) 我很难做一个简单的事情str_replace.
我试图从字符串中删除所有逗号,这确实有效.但是当我再次尝试改变字符串时,逗号再次以某种方式重新出现.我重构了我的代码以确保我没有引起这个.
无论如何这里是我的代码.任何人都可以发现一个错误吗?
$delim=remDelim(fgets($fo));
# echo 'before : '.htmlspecialchars($delim);
$delime =str_replace(",",",",$delim);
echo 'after : '.htmlspecialchars($delime);
$delimed = str_replace("<","",$delime);
echo $delimed.'<br />';
example output:
Jose, jr to Jose, jr to Jose, jr
Run Code Online (Sandbox Code Playgroud)
它就像我的字符串不知何故未被转换.我会说,我很可能把名字混淆了,并用第一个字符串来制作最后一个.但唉,我可以看到情况并非如此.