Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
How To Resolve “Notice: Array To String Conversion In”
Jessica replied to copperspeed's topic in PHP Coding Help
Nevermind, re-read the function. -
You need to check for errors. See the link in my signature - it contains mysqli information but the same concept applies with any DB. Check the PHP manual for the functions you'll need.
-
How To Resolve “Notice: Array To String Conversion In”
Jessica replied to copperspeed's topic in PHP Coding Help
I sure am. ARE YOU? Because you're the one trying to use it. As I said twice before your code doesn't indicate at all WHAT LIBRARY OR CLASS your $db object is. If you're trying to say it's just the basic PDO in PHP, then look at the manual! This is your code that you say has the problem. $res = $db->dbh->prepare($sql); $res->execute(array_values($params)); (array_values is superfluous). But later you posted this code: $ststres = $db->dbh->prepare("SELECT * FROM ".USERS_STATS." WHERE user_id = :uID ORDER BY id DESC LIMIT :zero, :forty"); $ststres->bindParam(':uID',$udata['id'],PDO::PARAM_INT); $ststres->bindValue(':zero',0,PDO::PARAM_INT); $ststres->bindValue(':forty',40,PDO::PARAM_INT); $ststres->execute(); Which part is giving you the error? {assign var='brgdatas' value=$brgObj->fetchOneBrg(array(['id'=>$ststres[ststval].to_id]))} Does it work when you use the function in PHP instead of in your Smarty tpl? You have a lot going on in that line of Smarty code, and the problem could be in there. -
How To Resolve “Notice: Array To String Conversion In”
Jessica replied to copperspeed's topic in PHP Coding Help
That has nothing to do with what I said. Clearly execute() wants a string. Did you write the function execute() or are you using a third party library? -
How To Resolve “Notice: Array To String Conversion In”
Jessica replied to copperspeed's topic in PHP Coding Help
Well it depends what your database class expects. You haven't said what class you're using, or any info on it. Look at what execute() expects to receive as arguments. -
How To Resolve “Notice: Array To String Conversion In”
Jessica replied to copperspeed's topic in PHP Coding Help
Please use our code tags, your post is very hard to read, especially with the background color. Most likely, the execute function expects a string with your SQL query, then the parameters to bind. -
You'd use an if() statement in your PHP. Post the code that constructs the table.
-
Srsly? Why??
-
In addition to what was already said, typically a "somethingID" would be a number, and should not be in quotes. You should ALSO be using the user ID not a username.
-
Honestly, you should probably be using CSS and PHP to do this rather than javascript.
-
I don't think you can bind a table name, it's for values only.
-
First of all, you should be explicit with your join. A join would look like this: SELECT t1.fields, t2.fields FROM t1 LEFT (or INNER) JOIN t2 ON t1.fk = t2.pk WHERE t1.field = 'value'; However, you need to explain your goal a little better. " looking through two tables to find one row" doesn't make much sense.
-
Php Hashtag Password Help, Returned Two Different Values!
Jessica replied to BrettHartel's topic in PHP Coding Help
Hashtag is a nickname for when people do #this on twitter. Hash is a one-way encryption of data. You cannot hashtag your data. You can hash it. -
Quite what? :-P
-
Check for errors in your query - see the link in my signature. With such a complicated query I'm sure there's an error. Getting the error message would help.
-
Are you guys seeing it in your browser? I'm using Chrome and I don't see it. I see it in the screencap obv.
-
What happens when you do a print_r on $results['public']['players'][0]? What about $results['public']['players']? and $results['public']? You need to try to do a little debugging now.
-
0 != '0'
-
$arr['public']['gq_numplayers'];
-
This doesn't make sense, you're NOT escaping twice. However, look at what you are doing different between insert and updated. 1. $request = mysqli_real_escape_string($myConnection, $request); 2. $praise = mysqli_real_escape_string($praise); What's different about these?
-
It wasn't a rant about you.
-
I know for a fact you've been told to research normalization, and you've also been spoon-fed information on proper normalization. You consistently ask questions about the same thing you've already been told how to handle it. Dogs have this thing where they are unable to generalize concepts. Are you a dog? Because that might explain why you need to be told every time to normalize your data, and stop pooping everywhere.
-
*shrug* It's not my fault that the last few generations have been so pampered and babied that they interpret emotionless facts as "not nice" and can't handle it when someone actually is being "not nice". Waaah self-confidence, Waaaah offended, Waaaah judging. Waaaaah grow up and stop getting so butt hurt. Op: read the links in my signature about SQL and errors. (Or all of them )
-
Can I Use If Else Statement In My While Loop?
Jessica replied to EzwanAbid's topic in PHP Coding Help
Look at the line before 90.- 8 replies
-
- if else
- while loop
-
(and 2 more)
Tagged with:
-
<link rel="stylesheet" type="text/css" href="style.css"> You need to use the full path to the css file, since you don't have a folder called the state's name.