Showing posts with label my_table. Show all posts
Showing posts with label my_table. Show all posts

Saturday, 6 February 2016

How to Convert From Clob to Varchar2 in OracleIn Feburary 2016 06,

In Feburary 2016 06,
Start Oracle’s SQL*Plus program.
Type the following statement into SQL*Plus:SELECT dbms_lob.substr( clob_field, 4000, 1 ) FROM my_table;For “clob_field,” substitute the name of the clob field you want to convert to varchar2. Substitute the name of your data table for “my_table.” For example, if the clob field name is “budget_memo” and the table’s name is “budgets,” type the following statement:SELECT dbms_lob.substr( budget_memo, 4000, 1 ) FROM budgets;
Press 'Enter.' SQL*Plus executes the statement.
In Feburary 2016 06,

Friday, 5 February 2016

How to Display Text From MySQL in PHPIn Feburary 2016 05,

In Feburary 2016 05,
Open your PHP source file with a text editor, such as Windows Notepad.
Use the 'mysql_query(query)' function to read a TEXT field from the active MySQL database. For example, '$my_result=mysql_query('Select my_var from my_table');' where 'my_var' is a TEXT field.
Use a 'while' loop and the 'mysql_fetch_assoc(my_result)' function to fetch rows from the MySQL result. For example, 'while ($my_values=mysql_fetch_assoc($my_result)) {}'.
Store the TEXT field value in a PHP variable, inside the 'while' loop. For example, '$str = $my_values['my_var'];'.
Use the 'nl2br' function to replace newline '\n' characters with ''. MySQL uses '\n' to signify a newline, but HTML uses ''. For example, 'echo nl2br($str);' will return the TEXT field with proper line breaks.
Save the PHP file.
In Feburary 2016 05,