We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

mysql table array problems

I have been having problems with this code and i cant find out why
I am trying to add a new element to an array. it says it goes throu butwhen i check its empty:

$sql="UPDATE $title SET arole = CONCAT_WS(',', arole, '$name')
WHERE op = '$name'";

if (!mysql_query($sql,$con))
{
    die('Error: ' . mysql_error());
}
else
{
    echo "Point Placed<br>";
    echo "<a href='index.php'>Return to Login</a>";
}
2
Contributors
1
Reply
56 Minutes
Discussion Span
2 Months Ago
Last Updated
16
Views
Question
Answered
CreatorZeus
Newbie Poster
6 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Put this temporary debug code on line 3:

die("UPDATE $title SET arole = CONCAT_WS(',', arole, '$name') WHERE op = '$name'";);

Your query will get displayed with actual values. Copy it to the SQL window of phpmyadmin and see what you get when you run it. If there are errors you will get error messages there that will help you solving the problem.

broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13
Question Answered as of 2 Months Ago by broj1

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0569 seconds using 2.69MB