EbrahemSamer

EbrahemSamer

Member Since 2 Years Ago

Experience Points
9,040
Total
Experience

960 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
64
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 2
9,040 XP
Jun
23
2 weeks ago
Activity icon

Replied to How To Make Mysql Treat ا ( Alef Character In Arabic ) Like أ ( Hamza Character In Arabic ) ? )

@ahmeddabak I've 0.5 million row and I do not know exactly what words have ( hamza ) to store them....

should I select them first and store them in database like you said ?

May
15
1 month ago
Activity icon

Started a new Conversation What Is The Difference Between __set(), __get(), __isset() And Normal Setter And Getter ( PHP )?

If I wanna implement setter and getter on my private properties

Should I make it like this

class User {

private $Id;
private $username;

public function set($property, $value)
{
	$this->$property = $value;
}

public function get($property)
{
	return $this->$property;
}

public function isSet($property)
{
	return isset($this->$property);
}

}

Or using __set() , __get(), __isset()

and what is the difference if I achieve the same result ...

thanks

Apr
29
2 months ago
Activity icon

Replied to Should I Learn MVC And Make A Project With It Before Learning Laravel ?

@tray2 Great thanks ...... Sorry wanna know something else If I've laravel project (5.8) ... Is it neccessary to update it to Laravel 7 or not ?

Activity icon

Started a new Conversation Should I Learn MVC And Make A Project With It Before Learning Laravel ?

I know the idea behind MVC and how it works but I never did a project using ( MVC ) Like Building my own controllers and model .....

the question is should I learn it and make real project on it or just moving on and learn Laravel ?

Mar
30
3 months ago
Activity icon

Replied to The Best Way To Make Custom HTML Validation Errors In Wordpress ?

@tisuchi I have mentioned in the title what I am talking about.

Activity icon

Started a new Conversation The Best Way To Make Custom HTML Validation Errors In Wordpress ?

I am building woocommerce website in Arabic language, I want change message like " value must be less than max_value " to validate number input to some thing in Arabic.

How could I do that ?

Mar
08
4 months ago
Activity icon

Replied to How To Iterate Though Array Of Arrays Using PHP ?

@latwelve question is simple and understandable

Activity icon

Replied to How To Iterate Though Array Of Arrays Using PHP ?

@tray2 I do not want that I want each element at every array with each element at others

Activity icon

Started a new Conversation How To Iterate Though Array Of Arrays Using PHP ?

I've array of arrays say and I wanna combine each element with every element:

[ [ahmed, omar , ali],

[mohammed, sayed],

[mostafa, ali],

]

I want the result to be like that [

'ahmed mohammed mostafa',

'ahmed mohammed ali',

'ahmed sayed mostafa',

'ahmed sayed ali'

...... same thing with omar and ali

]

need way or algorithms to make it, thanks

Mar
05
4 months ago
Activity icon

Started a new Conversation Where Should I Put Apc_clear_cache() Function To Clear System Cache ?

I am building website and I've search form that search on 1 million user and sometimes server get down ( internal server error )

I wanna clear system cache to reduce load on server , is using apc_clear_cache() will do that ?

If true, where should I put it in the end of every script or after any post request ?

thanks

Activity icon

Replied to How To Solve Internal Server Error PHP ?

I meant in general, I am not seeking to a specific answer. I wanted to know because of what this error occurs ? thanks. @snapey

Activity icon

Replied to How To Solve Internal Server Error PHP ?

@sinnbeck I am using pure php, I checked error.log and I found some warnings ...

Activity icon

Started a new Conversation How To Solve Internal Server Error PHP ?

Sometimes when I refresh the page or make any request in my website on bluehost server, I got "Internal Server Error 500"

How to stop this error and if this error because the request on the server hot reduce it or optimize it ?

Mar
03
4 months ago
Activity icon

Replied to How To Get The Current Datetime MYSQL - PHP ?

@siangboon result: system --- system

what is that mean

Activity icon

Started a new Conversation How To Get The Current Datetime MYSQL - PHP ?

I am trying to select now() from mysql and it gets time after 3 hours from now how to get the exact time .

I am working on server online

Mar
02
4 months ago
Activity icon

Started a new Conversation How To Read 5M Excel File And Inserted In In Mysql Database Using PHPExcel?

I am inserting excel file in database and it words fine with 2M files but from 3M to up can not be inserted it just treated like empty files I do not know why....

Here is my code...

include "classes/PHPExcel/IOFactory.php";

$table_name = filter_input(INPUT_POST, 'db_table_name', FILTER_SANITIZE_STRING);

$table_cols_names = $_POST['col_name'];
$table_cols_types = $_POST['col_type'];

$file_name = $_FILES['file']['tmp_name'];


$excelObject = PHPExcel_IOFactory::load($file_name);
$get_sheet = $excelObject->getActiveSheet()->toArray(null);


if( count($table_cols_names) != count($get_sheet[0]) )
{
    $_SESSION['new_election_error'] = "عدد الحقول غير متساويه داخل الملف";
    header("Location: /elections/?newelection=1");
    exit;
}

$query = "CREATE TABLE $table_name ( id INTEGER PRIMARY KEY AUTO_INCREMENT, ";

if(count($table_cols_names) == count($table_cols_types) ) {
    
    for($i = 0; $i < count($table_cols_names); $i++)
    {
        if($i == count($table_cols_names) - 1) {
            $query .= " " . $table_cols_names[$i] . " " . $table_cols_types[$i] . " ";
        }else {
            $query .= " " . $table_cols_names[$i] . " " . $table_cols_types[$i] . ", ";
        }
    }
} else {
    $_SESSION['new_election_error'] = "عمليه خاطئه, قم بإعاده المحاوله";
    header("Location: /elections/?newelection=1");
    exit;
}

$query .= " );";
if(! $pdo->query($query) )
{
    $_SESSION['new_election_error'] = "لم يتم انشاء الإنتخابات قم بإعاده المحاوله";
    header("Location: /elections/?newelection=1");
    exit;
}
$table_names_impleded = implode(', ', $table_cols_names);

for($l = 0; $l < floor(count($get_sheet) / 20000)+1; $l++) {
    
    $query = "INSERT INTO $table_name (id, ". $table_names_impleded .") VALUES ";
        
    for($i = ($l*20000)+1; $i < count($get_sheet); $i++)
    {   
            
        $query .= "(NULL, ";
        for($j = 0; $j < count($get_sheet[0]); $j++){
            if($j == count($get_sheet[0]) - 1) {
                $query .= "'". $get_sheet[$i][$j] ."'";
            } else {
                $query .= "'". $get_sheet[$i][$j] ."', ";
            }
        }
    
        if($i == ($l+1)*20000 || ( $i < ($l+1)*20000 && $i == count($get_sheet) - 1 ) ) {
            $query .= ");";
            $pdo->query($query);
            continue;
        } else {
            $query .= "),";
        }
        
    }
}

$_SESSION['new_election_success'] = "تم رفع البيانات بنجاح";
header("Location: /elections/?newelection=1");

any Ideas

Activity icon

Replied to What Is The Best Way To Insert 1 Million Rows Using Php & Mysql?

@jlrdw yes I am doing this but large file ( 4M ) does not work it deals with them like empty files

Feb
29
4 months ago
Activity icon

Started a new Conversation What Is The Best Way To Insert 1 Million Rows Using Php & Mysql?

I've tried to insert less that 1 M rows using insert like this ..

insert into table (col1,col2,col3) values (val1,val2,val3).......1 M

but but i get http error 500

I tried this using small data and it words fine how can i make it able t do that?

Feb
27
4 months ago
Activity icon

Started a new Conversation How To Use Inner Join Right.

I've two tables ( users, notifications ) and I am getting all notifications that related to any user.

ex: username , usertype, notification_type ......

no relation between them....

I am using inner join but it does not get all notifications just get some ....

-- query

SELECT notifications.user_id, notifications.type, notifications.seen, notifications.the_date, users.username, users.user_status, users.points, users.id FROM notifications JOIN users ON notifications.user_id = users.id ORDER BY notifications.seen

some notifications did not appear .... ( No DB Relation between them )

Feb
25
4 months ago
Activity icon

Replied to How To Solve -- Failed To Load Resource: Net::ERR_CONNECTION_RESET --

no other errors but sometime this errors get with it

( POST .. filename ... net::ERR_CONNECTION_RESET )

I think its the same error....

This happen on chrome yeah I did not try another browser but i read that happen with all @sinnbeck

Activity icon

Started a new Conversation How To Solve -- Failed To Load Resource: Net::ERR_CONNECTION_RESET --

I am sending ajax request and everything was working fine but suddenly this error -

( Failed to load resource: net::ERR_CONNECTION_RESET )

Start to show up at every ajax request and sometimes does not happen but usually it does .... I do not know why that happens ..

I am on real server using PHP

error_log is empty.

Feb
17
4 months ago
Activity icon

Started a new Conversation How To Send An Email Using PHP ?

I am on bluehost server and I find out that phpmailer is the best way to send an email.

What smtp to use ? the username is username of bluehost account ? the password is password of bluehost account ?

thanks

Feb
12
4 months ago
Activity icon

Replied to How To Search In Two Table Dynamically PHP ?

@sinnbeck Pure PHP, I want an idea..

also two tables have different fields.... and different rules for search

Activity icon

Replied to How To Search In Two Table Dynamically PHP ?

no the application will know which table to search in . @psylogic

Activity icon

Started a new Conversation How To Search In Two Table Dynamically PHP ?

I've two tables .. say users table and books table I wanna make search in both but I wanna write the code once dynamically . understand which table should look in and what fields should use to search.

Any Ideas ?

Feb
10
4 months ago
Activity icon

Replied to What The Best Way To Make User Able To Send Pdf Or Excel File To Whatsapp Through My PHP App ?

@fylzero yeah I know, how to send it from my server, is there an API to use

Activity icon

Started a new Conversation What The Best Way To Make User Able To Send Pdf Or Excel File To Whatsapp Through My PHP App ?

I am building an application and user can download pdf files and excel and there is a third option that he can send this file to his friend as pdf file in whats-app

what should I use to make that ?

Activity icon

Started a new Conversation Why Image Removed After Using It One Time PHP && TCPDF ?

I am using TCPDF to generate pdf files and i am using image as a background and it works fine for one time after that it removed from the server ?

my code

class MYPDF extends TCPDF {

public function Header() {

    $bMargin = $this->getBreakMargin();

    $auto_page_break = $this->AutoPageBreak;

    $this->SetAutoPageBreak(false, 0);

    $img_file = 'upload/pdf_image.jpeg';

    $this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);

    $this->SetAutoPageBreak($auto_page_break, $bMargin);

    $this->setPageMark();

    

}

}

Feb
08
5 months ago
Activity icon

Started a new Conversation What Is The Best Way Or Library To Convert Table To PDF And Download PHP ?

I am building website has many tables and i wanna include a button to each page so user can click on it and download this table in pdf , excel or send to whatsapp......

PHP

thanks

Feb
07
5 months ago
Activity icon

Started a new Conversation How Can I Get Device Name Or Any Unique Value In Device ?

I am making website that can only accessed in one device per account - so I wanna get some unique value for the computer or OS to depend on it.

How can i do that? ( PHP / JS )

Activity icon

Started a new Conversation How To Prevent User From Accessing His Account From Another Device ?

I am working on website and I want this user to login from one device or more if I want , How can i do this ?

I was thinking that cookies may help but he can pick another browser.....

Feb
06
5 months ago
Activity icon

Started a new Conversation How To Prevent Multiple Login Using The Same Account On Different Devices PHP ?

I am making website and I want the user to login on just one device....

I was thinking to add extra column in the database to set it to "active" when login and "not active" when logout and depend on it at each login process....

Is this good way to do that ... or there is a better and optimized solution ?

Activity icon

Started a new Conversation How To Arrange Mysql Query Result According To Where Conditions ?

I am running query like

$query = "SELECT * FROM students WHERE name = ahmed or age > 20";

the result will be any person has name ahmed or greater than 20 years

I want the name result get first ( all students have this name 'ahmed' ) not the age .

How can i do this ?

Activity icon

Started a new Conversation How To Update Mysql Character Sets To Support Some Arabic Chars ?

I am working on server and some arabic characters mysql does not support it or understand it , so I wanna find this file " /usr/share/percona-server/charsets/ " to update it ... How to find it .

characters :

wanna أ to be = ا

و == ؤ

and so on

Feb
02
5 months ago
Activity icon

Started a new Conversation How To Make Mysql Treat ا ( Alef Character In Arabic ) Like أ ( Hamza Character In Arabic ) ? )

I am searching for احمد

but name like أحمد do not get with the result because mysql understands that they're different characters

how to make them the same . any ideas ?

Activity icon

Started a new Conversation How To Replace Part Of String With * And Show The Rest ( PHP ) ?

I am searching using the name , I want the result of search to be like that

if i searched for any person start with 'ahmed' the result would be like that

ahmed ********* ahmed *** ahmed*

and so on just ahmed appears and the rest will be hidden like that how can i do that ?

Feb
01
5 months ago
Activity icon

Started a new Conversation How To Get Family Members Using Person's Name MYSQL ?

I've made sql statement to get brothers, uncles cousins and son of cousins if exist.

I typed this sql

$query = "SELECT secondname, thirdname, forthname, familyname, fullname, job, dob, address, internal_reference FROM public_elections WHERE";

                                    $query .= " ( secondname = '$secondname' && thirdname = '$thirdname') || ( secondname = '$thirdname' && thirdname = '$forthname' )";

                                    $query .= " || ( thirdname = '$thirdname' && familyname = '$familyname' ) || ( forthname = '$thirdname' ) ";

but still not working 100% correct and it gets persons not related.

how can i fix it.

Jan
28
5 months ago
Activity icon

Started a new Conversation How To Speed Up Search ( 1 Million Record ) PHP & MYSQL?

I am searching on table using query like this

select * from table_name where f_name = .... and l_name = ..... and gender = male and ... ............. etc

the result shows in 3 seconds, is there is any thing i can do to make it fast.. ( I am using PDO ).

Jan
27
5 months ago
Activity icon

Started a new Conversation Why PDO Insert Query Executed Two Times ?

I am inserting using this code

////////////////

$action_name = "بحث"; $action_doer_id = $_SESSION['user_id'];

$query = "INSERT INTO transactions (transaction_name, transaction_user_id, transaction_notes) VALUES ('$action_name', $action_doer_id, '$notes')";
$stmt = $pdo->query($query);
$stmt->execute();

//////////////

the result is two records added in database why ? ( note ) but there is a query before it should i call it query2 instead of query and stmt2 instead of stmt

Jan
22
5 months ago
Activity icon

Replied to How To Import Multiple CSV Files To Localhost Without Overwriting Data ?

I do not use any code, I just created an empty database on localhost and I have csv file, I wanna enter to my database on localhost and importing this csv file to fill my database with it .

it works fine but I upload another csv file , the old data removed and the new data in the new file inserted ( data overwritten ) I wanna when I upload another file, new data inserted after the old data... thanks.

@bobbybouwmann

Activity icon

Replied to How To Import Multiple CSV Files To Localhost Without Overwriting Data ?

@bobbybouwmann .. I mean importing from localhost not uploading using code

Activity icon

Started a new Conversation How To Import Multiple CSV Files To Localhost Without Overwriting Data ?

I wanna import csv file to localhost and It works correctly, when I import another one, old data gone,

I wanna continue on the old data not overwrite it.

Jan
21
5 months ago
Activity icon

Started a new Conversation How To Run Seed With 1 Million User ?

I wanna generate random users ( 1 million ) but I get this error how can i solve it ?

Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in C:\xampp\htdocs\blog\vendor\fzaninotto\faker\src\Faker\Provider\Base.php

Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php

Jan
14
5 months ago
Activity icon

Replied to How To Make CRUD Operations One Time For All Tables ?

@bugsysha Thanks , you mean I can not do that using PDO ?

Activity icon

Started a new Conversation How To Make CRUD Operations One Time For All Tables ?

I am making a gallary system using PHP OOP and I wanna make crud operation to work in all tables without issues.

I am trying that but the problem I am facing that how can get attributes for all classes dynamic and how to get the values of these attributes.

Wanna tutorial or guide to learn from it how to do that ... I am using PDO.