Giuseppe Maxia and Sheeri K. Cabral give an introduction to what MySQL is. A PDF of the slides can be downloaded at technocation.org (21 Mb). Links referred to in the presentation, or related to the presentation: The MySQL forge can be found at forge.mysql.com, which contains the Wiki (http as well as the worklog, code snippets and tools for use with MySQL. Planet MySQL is an aggregate of MySQL-related blogs, including Giuseppe’s and mine — planet.mysql.com The website for the 2009 MySQL User Conference and Expo is at http MySQL Camp is a free conference at the same time as the User Conference. The details, including the schedule, are at forge.mysql.com A collection of User Group videos is at technocation.org All the videos, including User Group ones, are at technocation.org The videos from the 2008 MySQL User Conference and Expo are at forge.mysql.com The videos from the 2007 MySQL User Conference and Expo are at www.technocation.org Episodes of the MySQL podcast can be found at technocation.org Learn more about MySQL University, a free, drop-in, weekly in-depth session of technical issues (such as MySQL internals) at forge.mysql.com MySQL Proxy information, including a getting started guide, can be found at forge.mysql.com
Question: Why does this script cause an error?
I konw it is something simple!
CustID=Request.QueryString(“CustID”)
ProdID=Request.QueryString(“ProdID”)
Qty=Request.QueryString(“Qty”)
CustID=cstr(CustID)
ProdID=cstr(ProdID)
Qty=cstr(Qty)
Set conn=Server.CreateObject(“ADODB.Connection”)
conn.Open “Provider=Microsoft.Jet.OLEDB.4.0; “& “Data Source=” & Server.MapPath(“/Data/Orders.mdb”)
SQL = “Insert Into Cart (CustID,ProdID,Qty) Values (‘”&CustID&”‘,’”&ProdID&”‘,’”&Qty&”‘)”
conn.Execute SQL
Set conn=nothing
RespStr= “The item has been added to your cart! You will have an opportunity at check-out to modify your order if you wish.”
Response.Write(RespStr)
Answer:
Answer by Slave to the Game
Please post the error.
Question: Problem with PHP an Ajax. How can I fix this problem?
function showUser(str)
{
if (str==”")
{
document.getElementById(“txtHint”).innerHTML=”";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“txtHint”).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open(“GET”,”po.php?q=”+str,true);
xmlhttp.send();
}
$ q = $ _GET['q'];
$ sql="SELECT * FROM tbl_product WHERE productCode = '".$ q."'";
$ result = mysql_query($ sql);
$ row = mysql_fetch_assoc($ result);
echo "
| Product Name | Price | SRP | Quantity Ordered | Total Amount |
|---|---|---|---|---|
| ” . $ row['productName'] . “ | ” . $ row['price'] . “ | ” . $ row['srp'] . “ | ” . $ row['optimumLevel'] . “ | ” . $ getQa['totalAmount'] . “ |
“;
The error is: Undefined index: q
Please Help
the variable $ q is the one that I want to search for.
And I don’t have any page that contains the variable of q just like what you said, index.php?q=123456. Please help.
Answer:
Answer by Ryan
cheese
Question: how can I solve this error:datatype mismatch in criteria expression ?
in this example error is on cmd.execute non query();
cnn.ConnectionString = “Provider=Microsoft.jet.OLEDB.4.0; Data Source=” + path;
cnn.Open();
string sql = “INSERT INTO ink ([تاریخ خرید], [تعداد قوطی], فروشنده, مارک, [موجودی باقیمانده], [موجودی کل], [نوع جنس], [وزن هر قوطی], [کشور سازنده]) VALUES (‘” + textBox3.Text + “‘,’” + textBox7.Text + “‘,’” + textBox1.Text + “‘,’” +textBox2.Text + “‘,’” + textBox8.Text + “‘,’” + textBox4.Text + “‘,’” + textBox5.Text + “‘,’” + textBox6.Text + “‘,’” + label11.Text + “‘)”;
OleDbCommand cmd = new OleDbCommand(sql, cnn);
cmd.ExecuteNonQuery();
Answer:
Answer by MuffinMan
I have had this happen when coding ASP pages. Usually a mismatch is caused by trying to insert text into a integer field on your SQL db, but it can happen when trying to write null data to the db also.
what I did to resolve it was (in vbscript) use the CInt,CLng,CSng, etc functions to convert my data to the correct type for my SQL table, but I also setup a small If… Then to catch the nulls like:
If textbox = “” then
textbox = 0
End If
Hope this helps! Good Luck!!
Question: Why does mysql keep inserting data in random places and how can I fix this?
I am using mysql 5.0.51a with php 5.2.5
I am using the insert command to enter data.
It keeps inserting data in random locations in the table, which is messing up my web app.
It did use an id column at one time.
I’ve tried flushing the table, and remaking the table with phpmyadmin’s sql dump.
How can I fix this? I just want mysql to insert data at the end of the table, like it should.
Answer:
Answer by colanth
Data is inserted pseudorandomly in a database. The order in which you see it in a select statement is determined by the ORDER BY or GROUP BY parts of the select. *NO* database guarantees insert order. (It’s not actually random, but you’d have to study the source code of the database to learn how the order is determined. It’s almost never last-in/last-in-order.)
If you’re depending on the latest inserted data being last in an unordered select, that’s where the problem lies.
Question: whats wrong in this program guys…?
<%@ page import="java.sql.*" %>
<% Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); %>
<% Connection con=DriverManager.getConnection("jdbc:odbc:suresh","sa","sa");
Statement stmt = conn.createStatement();
ResultSet columns = stmt.executeQuery("select * from employee");
while(columns.next())
{
String name = columns.getString("name");
String address = columns.getString("address");
%>
<%=name%>
<%}%>
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the jsp file: /f.jsp
conn cannot be resolved
3: <%@ page import="java.sql.*" %>
4: <% Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); %>
5: <% Connection con=DriverManager.getConnection("jdbc:odbc:suresh","sa","sa");
6: Statement stmt = conn.createStatement();
7: ResultSet columns = stmt.executeQuery("select * from employee");
8: while(columns.next())
9: {
Answer:
Answer by fang
what is the error message?
Question: what is wrong with this SQL statement’s syntax?
SQL Statement
INSERT INTO Account (Fname,Lname,Address,
Username,Password,Email,Activated) VALUES
(“fred”,”flintstone”,”bedrock rd”,”fredflinstone”,”fredflintstone”,
“fredflintstone@nowhere.com”,”yes”)
Source code that generates error message “Syntax error in INSERT INTO statement.”
Dim Conn = Server.CreateObject(“ADODB.Connection”) ‘Holds the Database Connection Object
‘ Dim rsGuestbook ‘Holds the recordset for the records in the database
Dim strSQL As String ‘Holds the SQL query to query the database
Conn.Open(“Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=c:\db1.mdb”)
sql = “INSERT INTO Account (Fname,Lname,Address,Username,Password,Email,Activated) VALUES ”
sql = sql & “(‘” & Request.Form(“Fname”) & “‘,”
sql = sql & “‘” & Request.Form(“Lname”) & “‘,”
sql = sql & “‘” & Request.Form(“Address”) & “‘,”
sql = sql & “‘” & Request.Form(“Username”) & “‘,”
sql = sql & “‘” & Request.Form(“Password”) & “‘,”
sql = sql & “‘” & Request.Form(“Email”) & “‘,”
sql = sql & “‘yes’)”
sql = Replace(sql, “‘”, Chr(34))
‘Exit Sub
Conn.Execute(sql) ‘ Crashed here with Syntax error in INSERT INTO statement.
Double checked the fields. Database file was created in Access 2000. Text fields are
Fname, Lname, Address, Username, Password, Email. Activated is a yes/no value.
Can’t figure this out it looks valid.
Answer:
Answer by dravalley.com
lol.looks ok to me.
Categories
Tags
2005 2008 Access Apache Best Build connect Create Creating data database display error Excel from Handson INSERT Install Internet into Introduction learn Microsoft MySQL O'Reilly Oracle page Part phpMyAdmin problem Querying server statement table Tables this Tips Training Tutorial Tutorials Using Video Visual website Windows


