[Solved] How to print in PHP blank page

Unlike python, printing in php is done with the echo statement. In order to execute your code, you would do: <?php echo “Hello, World!”; ?> You can check out a great beginner tutorial on php here. <?php print(“Hello World”); ?> 0 solved How to print in PHP blank page

[Solved] INSERT row from another table using php PDO

Ok, so the issues you had/have were: $barCode = $GET[‘id’]); should have been $barCode = $GET[‘id’];, and possibly even $_GET[‘id’]; Your SELECT query selects the same field twice (SELECT Brand, Description, >Price<, Size, >Price<) You’re also inserting in the same field twice: INSERT INTO adstable (Brand, Description, >Price<, Size, >Price< You’re vulnerable to injection attacks, … Read more

[Solved] Get any user_id from Facebook url

You cannot get any Facebook’s User data using the Facebook API without the User’s explicit permission. The permission is granted to you (your APP) by the user in a popup window stating exactly what information you are receiving and with which permission type (read, write etc..) This is all for good reasons. 7 solved Get … Read more

[Solved] Get Weekends between two dates if present in php [duplicate]

This will do what you need, though you might want to tweak it to fit your project. <?php $date=”01-Aug-2018″; $date2 = ’07-Aug-2018′; $period = new DatePeriod( new DateTime($date), new DateInterval(‘P1D’), new DateTime($date2) ); $weekends = []; foreach ($period as $key => $value) { if ($value->format(‘N’) >= 6) { $weekends[$value->format(‘d-m-Y’)] = $value->format(‘D’); } } var_dump($weekends); 1 … Read more

[Solved] OOP login page error [closed]

This is because function is outside the class. Should be <?php include(“config.php”); class User { //Db Connect public function __construct() { $db=new db_class(); } // Registration Process public function register_user($name,$username,$password,$email) { $password=md5($password); $sql=mysql_query(“select * from login where username=”$username” or emailid=’$email'”); if(mysql_num_rows($sql)==0) { $result=mysql_query(“insert into login(username,password,name,emailid) values(‘$username’,’$password’,’$name’,’$email’)”); return result; } else { return false; } } … Read more

[Solved] Strange behavior with SELECT WHERE A=”$var” SQL [duplicate]

Since I raised the idea, I suppose I should illustrate the use of prepared statements. Using mysqli one would proceed as follows (assuming $connection has been successfully initialized): // The indentation here is purely a matter of personal preference $query = ‘SELECT business_name, vd.ID_Vendor, res.ID_RestaurantEstablishment FROM restaurant res INNER JOIN vendor_data vd ON vd.ID_Vendor = … Read more