[Solved] php username that checks on database “username already taken” [duplicate]

Please use below code to fix your problem <?php if(empty($_POST[‘username’])){ $username_error = “Please Input Username”; }else{ if( 6 > mb_strlen($_POST[‘username’]) || 20 < mb_strlen($_POST[‘username’])){ $username_error = “username must be at least 6 characters.”; }else{ $username = $_POST[‘username’]; $sql = “SELECT members.username FROM members WHERE username=””. $username.”””; $res = mysql_query($sql); if($res && mysql_num_rows($res) > 0){ $username_exists … Read more

[Solved] Math Results Inaccurate PHP [closed]

In the line $open = fopen(“http://quote.yahoo.com/d/quotes.csv?s=$symbol&f=sl1d1t1c1ohgv&e=.csv”, “r”); You need to substitute the actual symbol, not leave it as a string in the query. Maybe something like this: $open = fopen(“http://quote.yahoo.com/d/quotes.csv?s=”.$symbol.”&f=sl1d1t1c1ohgv&e=.csv”, “r”); to concatenate the symbol will help. If you have an invalid request, you are probably looking at garbage. Also – you need to make … Read more

[Solved] 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 ‘)’ at line 5

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 ‘)’ at line 5 solved 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 … Read more

[Solved] change mysql to pdo and store result in variable

Try this: <?php $games_sql = “SELECT id,col1,col2,now FROM tblname ORDER BY now ASC LIMIT 9”; $sth = $conn->query($games_sql); $sth->setFetchMode(PDO::FETCH_ASSOC); $gn=0; while ($game_get = $sth->fetch()) { $id = $game_get[‘id’]; $col1 = $game_get[‘col1’]; $col2 = $game_get[‘col2’]; $now = $game_get[‘now’]; $gametimeanddate = jdate(“l d M y time G:i”,$now); $gamedate = jdate(“l d M y”,$now); $gametime = jdate(“G:i”,$now); //SAVE … Read more

[Solved] How to remove first letter if it is number in sql?

You could use the RIGHT() part of the string filtering wher the firts is a number eg: SELECT right(my_column, LENGTH(my_column)-1) FROM my_table WHERE my_column REGEXP ‘^[0-9]’ for update (remove the number ) you could use Update my_table set my_column= right(my_column, LENGTH(my_column)-1) WHERE my_column REGEXP ‘^[0-9]’ 1 solved How to remove first letter if it is … Read more

[Solved] Is condition considered a special word in mySQL?

Yes, condition is a reserved word as of MySQL 5.0. Your original Create Table works because you can use ` to quote reserved words for use in table/field names. Works: SELECT * FROM `condition`; DROP TABLE `condition`; # etc. Doesn’t: SELECT * FROM condition 0 solved Is condition considered a special word in mySQL?

[Solved] Fatal error in if stament [duplicate]

Just change the condition to: if(isset($_REQUEST[‘userid’]) && $_REQUEST[‘userid’] > $user_hack) isset tells is a variable is set, while this statement may be true or false, on which you cannot call isset function. Until you check if(isset($_REQUEST[‘userid’])), you cannot assign it to $userid variable. 2 solved Fatal error in if stament [duplicate]