Advertisement

07.16.2008 at 01:16PM PDT, ID: 23571151
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

MySQL Error when I try to insert data

Asked by kmc10314 in PHP and Databases, MySQL Server

Tags:

My error looks like this
: Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\WebServer\Apache2\htdocs\LiveCamTutor\form_insert.php on line 9
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 '„, Ý|, 1Ä, Y%, Ñü_, ÑT, xÜð, tT|, $t¸(, MSN, ñ]|) V' at line 1

Can anyone tell me what's going on?
Here's the code if you need to look at them

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
<?php require_once('Connections/LiveCam.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) 
{
	function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
	{
	  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
	  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
	  switch ($theType) {
	    case "text":
    	  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
	      break;    
    	case "long":
	    case "int":
    	  $theValue = ($theValue != "") ? intval($theValue) : "NULL";
	      break;
    	case "double":
	      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
    	  break;
	    case "date":
    	  $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
	      break;
    	case "defined":
	      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
	      break;
	  }
  return $theValue;
}
 
$homePhone = $_POST['1H']."-".$_POST['2H']."-".$_POST['3H'];
$cellPhone = $_POST['1C']."-".$_POST['2C']."-".$_POST['3C'];
$birthDay = $_POST['year']."D".$_POST['month'].'Ô'.$_POST['date'].'|';
$grade = $_POST['school']." ". $_POST['grade']; 
 
mysql_select_db($database_LiveCam, $LiveCam);
$query_Students = "SELECT * FROM Members";
$Students = mysql_query($query_Students, $LiveCam) or die(mysql_error());
$row_Students = mysql_fetch_assoc($Students);
$totalRows_Students = mysql_num_rows($Students);
 
$insertSQL = sprintf("INSERT INTO Members (t„, Ý|, 1Ä, Y%, Ñü_, ÑT, xÜð, tT|, $t¸(, MSN, ñ]|) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['name'], "text"),
                       GetSQLValueString($birthDay, "text"),
					   GetSQLValueString($_POST['gender'], "text"),
                       GetSQLValueString($grade, "text"),
                       GetSQLValueString($_POST['address'], "text"),
                       GetSQLValueString($homePhone, "text"),
                       GetSQLValueString($cellPhone, "text"),
                       GetSQLValueString($_POST['emailAddress'], "text"),
                       GetSQLValueString($_POST['nateOnID'], "text"),
                       GetSQLValueString($_POST['msnID'], "text"),
                       GetSQLValueString(getdate(), "text"));
 
mysql_select_db($database_LiveCam, $LiveCam);
$Result1 = mysql_query($insertSQL, $LiveCam) or die(mysql_error());
}
 
header ('Location: contact.php');
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
</head>
 
<body>
</body>
</html>
<?php
mysql_free_result($Students);
?>
 
Loading Advertisement...
 
[+][-]07.16.2008 at 01:23PM PDT, ID: 22019772

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:24PM PDT, ID: 22019788

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:25PM PDT, ID: 22019794

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:28PM PDT, ID: 22019819

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:29PM PDT, ID: 22019825

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:34PM PDT, ID: 22019873

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:55PM PDT, ID: 22020045

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 02:09PM PDT, ID: 22020186

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 02:37PM PDT, ID: 22020443

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 02:52PM PDT, ID: 22020573

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 03:30PM PDT, ID: 22020777

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 03:34PM PDT, ID: 22020798

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 03:38PM PDT, ID: 22020823

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 03:55PM PDT, ID: 22020943

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 04:18PM PDT, ID: 22021041

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP and Databases, MySQL Server
Tags: PHP and MySQL
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.16.2008 at 06:32PM PDT, ID: 22021659

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628