Code: Select all
$queries = preg_split('/;/',$sql);Code: Select all
$sql = "
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 30, 2011 at 09:38 AM
-- Server version: 5.1.56
-- PHP Version: 5.2.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `newssc3_bt`
--
-- --------------------------------------------------------
--
-- Table structure for table `wp_links`
--
CREATE TABLE IF NOT EXISTS `wp_links` (
`link_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`link_url` varchar(255) NOT NULL DEFAULT '',
`link_name` varchar(255) NOT NULL DEFAULT '',
`link_image` varchar(255) NOT NULL DEFAULT '',
`link_target` varchar(25) NOT NULL DEFAULT '',
`link_description` varchar(255) NOT NULL DEFAULT '',
`link_visible` varchar(20) NOT NULL DEFAULT 'Y',
`link_owner` bigint(20) unsigned NOT NULL DEFAULT '1',
`link_rating` int(11) NOT NULL DEFAULT '0',
`link_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`link_rel` varchar(255) NOT NULL DEFAULT '',
`link_notes` mediumtext NOT NULL,
`link_rss` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`link_id`),
KEY `link_visible` (`link_visible`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;
--
-- Dumping data for table `wp_links`
--
INSERT INTO `wp_links` (`link_id`, `link_url`, `link_name`, `link_image`, `link_target`, `link_description`, `link_visible`, `link_owner`, `link_rating`, `link_updated`, `link_rel`, `link_notes`, `link_rss`) VALUES
(22, 'http://kikolani.com/', 'Kikolani', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(23, 'http://jobhits.net/blog/', 'Job Search Blog', '', '', 'Lastest news and updates recruitment and employment.', 'Y', 2, 0, '0000-00-00 00:00:00', '', '', ''),
(24, 'http://jobhits.net/Seo-jobs', 'Seo Jobs', '', '', 'Seo Jobs', 'Y', 2, 10, '0000-00-00 00:00:00', '', '', 'http://jobhits.net/services/rss?k=seo'),
(21, 'http://www.webuildyourblog.com/', 'Blogging Guide', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(17, 'http://ma.tt/', 'Matt Mullenweg', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(19, 'http://www.blogussion.com/', 'Blogussion', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(20, 'http://weblogbetter.com/', 'We Blog Better', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(25, 'http://www.buyrealfacebookfans.com', 'Get Facebook Fans', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(26, 'http://www.cssformatter.com/', 'Format CSS', '', '', '', 'Y', 1, 0, '0000-00-00 00:00:00', '', '', ''),
(27, 'http://wwww.place.vn/', 'Vietnam Place', '', '_blank', 'Vietnam Places', 'Y', 2, 0, '0000-00-00 00:00:00', '', '', '');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
";Code: Select all
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";If I take that part out, preg_split functions properly and splits the giant string just the way I want it. But it won't process the above lines. if I include those lines it doesn't store anything into the array. any help would be greatly appreciated ...