LAPM 03

2017. 6. 17. 06:38Work/LAPM

728x90
반응형

https://phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=351586&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%BC%BC%BC%C7&sop=and    :) php.ini 권한 해줘야 세션이 다른 브라우저에서도 연동된다


https://zetawiki.com/wiki/PHP_세션_로그인_구현    :) php 세션


세션 사용

---------------------

session_start(); 세션 시작

$_SESSION['user_id'] = 'guest'; 세션 설정

unset( $_SESSION['세션변수명'] ); 특정 세션 삭제

session_destroy(); 전체 세션 삭제

---------------------


http://delirussum.tistory.com/entry/MY-SQL-mysqlfetchrow함수와-mysqlfetcharray함수의-차이점    :) fetch row

http://88240.tistory.com/91    :) fetch row


ALTER TABLE test_table AUTO_INCREMENT=1  -> 초기화


http://anisotropic.jinbo.net/blog/archives/96 gmail smtp


https://stackoverflow.com/questions/10648984/php-sessions-that-have-already-been-started    :) 

Notice: A session had already been started - ignoring session_start() 시에


mysql 원하는 테이블 삭제

--------------------

  1. delete from student where name like '고길동';



Mysql 데이터

백업 (Export)

$ myslqdump -u DB계정명 -p DB명 [Table명] > 저장할 파일명

# example
$ mysqldump -u root -p mysql > mysql.sql

위 명령어로 수행하면 mysql.sql 이라는 파일이 생성되고, 파일내에는 스키마를 생성하는 명령어, 데이터를 Insert 하는 명령어들이 나열되어 있습니다.
백업을 통해 생선된 파일을 그대로 복구(import)에 이용할 수 있습니다.

복구(Import)

$ mysql -u DB계정명 -p DB명 [Table명] < 불러올 파일명

# example
$ mysql -u root -p mysql < mysql.sql



warning mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean given 뜨면 아래처럼 에러 코드를 봐보자 (대부분 mysql 연결 실패)


$result = mysqli_query($conn, $query) or die(mysqli_error($conn));



에러1 : Call to undefined function mb_substr() in ~~ 물리적인 주소 에러 

에러2 : The mbstring extension is missing. Please check your PHP configuration.


이것은 php-mbstring 모듈을 설치하면 해결 됩니다.


yum install php-mbstring -y



GD 라이브러리 설치

http://zetawiki.com/wiki/CentOS_GD라이브러리_설치


image GD 처리

http://www.dreamy.pe.kr/zbxe/CodeClip/165507

https://webtechball.wordpress.com/2015/03/15/how-to-upload-and-resize-an-image-through-gd-php/



javascript iframe 변경


<input oninput="linkfun(this.value)" onkeyup="document.getElementById('link').innerHTML=this.value" class="form-control" type="text" name="user_link" placeholder="Enter Link" value="<?php echo $userlink; ?>"/>

<p id="link"></p>

<iframe width="300" height="300" id="linkframe" name="linkframe" src="" frameborder="0" allowfullscreen></iframe>


<script type="text/javascript">

function linkfun(value){

document.getElementById('linkframe').src = value;

}

</script>



728x90
반응형

'Work > LAPM' 카테고리의 다른 글

LAPM 02  (0) 2017.05.30
LAPM 01  (0) 2017.05.25