Jump to content

Search the Community

Showing results for tags 'concat'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 5 results

  1. Hi all, I have a php file to check a users input and it seems pretty straight-forward as far as logic goes, but the variable seems to be concatenating the "badEntry" onto its return value. I've been over it and over it and can't seem to see what's wrong. I originally had $userInput as the only return variable, but when I started having trouble I added the $toReturn variable to hopefully make it clear what I was doing wrong. Didn't help. I enter 'sakde12345' and I get that back with 'BadEntry' concatenated to it - looks like this - sakde12345BadEntry. My callback function is supposed to see if the return value is equal to 'BadEntry' and of course it isn't because it somehow includes the original input in front of it. It's returning this for either 'good' or 'bad' input. Can anyone figure out how I've miscoded or what? I also had a question about the debugger in chrome when I was running the js that called this php in the xmlhttprequest. The debugger traced thru everthing OK, but when it came to the 'onreadystatechange', it went to the 'xhr.open' line, jumped back to the onreadystatechange ( which became 1) but then it jumped to the requestheader line, then the .send line, then it jumped back to the js function that called the xhr request, then it jumped all the way back to the button in html that submitted the input. That kind of surprised me to see that - is the program just gathering information to proceed or something like that? I know it's kind of a weird question, but I'd like to understand what is going on. Thanx for any help, and I appreciate your patience!!! <?php $toReturn = ""; $userInput = ""; $chars = []; $i = 0; if ($_SERVER["REQUEST_METHOD"] == "POST"){ $userInput = $_POST["userID"]; // Get variable passed to xmlhttp call $userInput = test_input($userInput); // Run it thru easy data cleaner $userInput = strtolower($userInput); // change all to lower case $toReturn = $userInput; $chars = str_split($userInput); // split input into single characters if (strlen($userInput) != 10) { // is the input exactly 10 chars long $toReturn = "BadEntry"; } else { if (substr($userInput,0,3) != "sak") { // are the 1st 3 letters 'sak' $toReturn = "BadEntry"; } else { if (is_not_Char($chars[3]) || is_not_Char($chars[4])) { // are the 4th & 5th chars letters - name initials $toReturn = "BadEntry"; } else { for ($i = 5; $i < 10; $i++){ if (is_not_Numb($chars[$i])) { // are the last 5 chars Numbers $toReturn = "BadEntry"; } } } } } } echo $toReturn; function is_not_Char($examp){ $charBool = false; if ($examp < chr(97) || $examp > chr(122)) { // is it a lowercase letter - ascii 97 - 122 $charBool = true; } echo $charBool; } function is_not_Numb($examp){ $charBool = false; if ($examp < chr(48) || $examp > chr(57)) { // is it a number - ascii 48 - 57 ( 0 - 9 ) $charBool = true; } echo $charBool; } function test_input($data) { // standard data cleansing tools $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); echo $data; } ?>
  2. How to write GROUP_CONCAT_MAX_LEN Increasing as per requriement in perticuar select query in php.....
  3. how to increase group caoncat length in sql quaries.....? please give me suggestions........
  4. Hello guys, i need some basic info here. I need to build string, which must be builded into "'%name%'", when name is a variable. Using concat, its easy to do that:String myString = "'%" + name + "%'";how to do that with String.format() ?I`m trying to do like: String myString = String.format("'%%s%'", name); << it appears a problem with "%'" tag. how to avoid that ? How to use double %`s in the quotas ?Any suggestions ? Linas.
  5. ibrahimjan

    CONCAT sql

    Hi All, I got this sql connection to my table wb, it all seems to work fine in phpmyadmin, when testing sql, but when i want to us it, it comes up with: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING inC:\----------\test3.php on line 75 line 75 is the $query_wb $query_wb = "SELECT CONCAT( "[", GROUP_CONCAT( CONCAT("{weID:'",`weID`,"'"), CONCAT(",weName:'",`weName`,"'}") ) ,"]") AS json FROM wb;"; any Ideas how to make it work??
×
×
  • Create New...