Anonymous,

Please Login or Register
Download Nuke Evolution Xtreme today for a CMS you can enjoy using and sharing with your friends!
[ Download Now ]
Forum Index  ·  Search  ·  Usergroups  ·  Edit your profile  ·  Members  ·  Login, Check Messages
Arcade  ·  Ranks  ·  Staff  ·  Statistics  ·  Board Rules  ·  Forum FAQ  ·  Log in

Search for at
Evolution-Xtreme Advanced Search


+  
Latest Site News   Next 5 >>  
 Forum   Author   Replies   Last Post 
File Repository 1.0.0 Released Announcements! Lonestar 0 Tue Apr 26, 2016 6:44 am
Lonestar View latest post
Image Repository Released Announcements! Lonestar 1 Mon Oct 27, 2014 7:39 pm
Lonestar View latest post
So what happened to us? Announcements! SgtLegend 0 Tue May 06, 2014 12:32 am
SgtLegend View latest post
[PROGRESS] Nuke Evolution Xtreme 2.0.9e Announcements! SgtLegend 2 Sun May 27, 2012 6:25 pm
SgtLegend View latest post
European Cookie Law Announcements! SgtLegend 0 Sat May 26, 2012 7:33 am
SgtLegend View latest post
   
Recent Topics   Next 15 >>  
 Forum   Author   Replies   Last Post 
Evo staff looking for some volunteers. Community Announcements coRpSE 20 Thu Jul 02, 2015 9:19 am
Depresjon2 View latest post
Evo Xtreme 2.0.9D Updated for PHP 5.6 General Support coRpSE 121 Thu Mar 23, 2017 3:57 pm
casterdon View latest post
[ MOD ] - Honeypot V2.2 AntiBot Module Security coRpSE 106 Tue Nov 22, 2016 11:30 am
coRpSE View latest post
Possible new Admin area layout Comments and Suggestions Lonestar 18 Wed Sep 14, 2016 11:37 am
Blackou View latest post
jQuery update General Support Lonestar 2 Wed May 11, 2016 4:49 pm
Charles64 View latest post
Deutsche Sprachdatei - german language files German DT50R 7 Thu Jan 28, 2016 7:04 am
DT50R View latest post
[FIX] Correct Cookie Settings (Invalid Session Error) Quick fixes killigan 110 Fri Mar 20, 2015 1:06 pm
Macdaddy View latest post
Admin General Support bomclan 3 Sat Jun 17, 2017 6:01 pm
Sp0rAdiC View latest post
RSS feeds Blocks Richmc 1 Sat Jun 17, 2017 5:52 pm
Sp0rAdiC View latest post
Forums disappeared General Support Richmc 0 Fri Jun 16, 2017 9:20 am
Richmc View latest post
admin access help needed General Support Soulfly 13 Fri Jun 09, 2017 3:08 pm
Soulfly View latest post
mysql_error ? General Support Redcougarxr7 5 Thu Jun 08, 2017 8:27 am
coRpSE View latest post
Question about domain name General Support Richmc 0 Wed Jun 07, 2017 11:03 am
Richmc View latest post
PM System not working correctly General Support Worfwarrior 0 Fri Jun 02, 2017 8:24 am
Worfwarrior View latest post
Looking for coRpSE? He is gone till May. General Chat coRpSE 9 Tue May 30, 2017 9:19 am
Soulfly View latest post

A question about setting up SQL queery in this CMS

 
Post new topic    Reply to topic    printer-friendly view   Thank Post    Evolution-Xtreme Forum Index -> General Support
View previous topic :: View next topic  
Author Message
SnakZ
Xtreme Contributor
Xtreme Contributor



Gender: Gender:Male
Joined: Jul 14, 2010
Age: 31
Posts: 735
Location: MD
Reputation: 70.9
votes: 4
usa.png


Status: Offline
Web Control Panel: xampp 1.7.4
PostPosted: Tue Feb 01, 2011 6:08 pm Post subject: No icon A question about setting up SQL queery in this CMS Reply with quote

 $db->sql_query  vs  sql_query
 $db->sql_query  vs  mysql_query
 $db->sql_fetchrow  vs  sql_fetch_row
 $db->sql_numrows  vs  sql_num_rows
 
 why  is  it  that  u  use  $db  ?  
 and  do  u  just  add  $db->  to  ANY  type  of  query  ?
 
 i  have  a  mysql_fetch_array
 so  i  make  it  
 $db->sql_fetch_array  ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger Visit member's Facebook: 720050661 MySpace Profile: zzsnakzz
SgtLegend
Site Admin
Site Admin
Lead Developer
Lead Developer
DFG Developer
DFG Developer



Gender: Gender:Male
Joined: Oct 11, 2008
Age: 26
Posts: 5169
Location: Australia
Reputation: 616.1
votes: 27
australia.png


Status: Offline
Web Control Panel: WHM
PostPosted: Tue Feb 01, 2011 6:40 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 $db  is  the  instance  of  the  MySQL  connection,  for  example
 
 
                                                 
Code:                
$db->sql_query()  -  Works  because  its  part  of  the  $db  instance
 sql_query  -  Won't  work  because  its  not  a  valid  function                

 
 All  the  basic  nuke  methods  are  as  follows
 
 
                                                 
Code:                
mysql_query  -  $db->sql_query
 mysql_num_rows  -  $db->sql_numrows
 mysql_fetch_row  -  $db->sql_fetchrow
 mysql_fetch_array  -  $db->sql_fetchrowset
 mysql_real_escape_string  -  $db->sql_escape
 mysql_insert_id  -  $db->insert_id                
Back to top
View user's profile Send private message Visit poster's website
SnakZ
Xtreme Contributor
Xtreme Contributor



Gender: Gender:Male
Joined: Jul 14, 2010
Age: 31
Posts: 735
Location: MD
Reputation: 70.9
votes: 4
usa.png


Status: Offline
Web Control Panel: xampp 1.7.4
PostPosted: Tue Feb 01, 2011 6:44 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 i  did  
 function  index($title)  {
   global  $db,
 
 and  any  any  SQL  i  do  work  fine  with  out  the  $db->  is  this  the  wrong  way  to  do  things  ?  should  i  leave  $db  out  of  the  global  and  only  use  it  in  the  SQL  query  ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger Visit member's Facebook: 720050661 MySpace Profile: zzsnakzz
Sponsor
phpstorm.jpg
SgtLegend
Site Admin
Site Admin
Lead Developer
Lead Developer
DFG Developer
DFG Developer



Gender: Gender:Male
Joined: Oct 11, 2008
Age: 26
Posts: 5169
Location: Australia
Reputation: 616.1
votes: 27
australia.png


Status: Offline
Web Control Panel: WHM
PostPosted: Tue Feb 01, 2011 6:58 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 Could  you  please  post  your  full  code  as  its  hard  to  tell  what  the  issue  is  without  seeing  it
Back to top
View user's profile Send private message Visit poster's website
SnakZ
Xtreme Contributor
Xtreme Contributor



Gender: Gender:Male
Joined: Jul 14, 2010
Age: 31
Posts: 735
Location: MD
Reputation: 70.9
votes: 4
usa.png


Status: Offline
Web Control Panel: xampp 1.7.4
PostPosted: Tue Feb 01, 2011 7:08 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 there  is  no  issue  lol  im  making  a  module  and  i  keep  seeing  
 some  modules  using  $db->sql_query  and  me  i  been  reading  up  on  pulling  data  from  SQL  and  they  all  say  use  sql_query  (without  $db->)  what  works  just  fine
 
 both  ways  work  just  fine  im  just  trying  to  find  out  what  is  it  for  lol  i  was  thinking  it  some  how  keeps  you  safe  or  something  when  i  google  it  i  get  "Database  Abstraction  Layer"  but  cant  tell  what  that  is  lol
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger Visit member's Facebook: 720050661 MySpace Profile: zzsnakzz
SgtLegend
Site Admin
Site Admin
Lead Developer
Lead Developer
DFG Developer
DFG Developer



Gender: Gender:Male
Joined: Oct 11, 2008
Age: 26
Posts: 5169
Location: Australia
Reputation: 616.1
votes: 27
australia.png


Status: Offline
Web Control Panel: WHM
PostPosted: Tue Feb 01, 2011 7:55 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 Like  i  explained  above  you  should  use  $db  as  its  the  instance  variable  for  the  database  class,  using  sql_query  should  return  a  function  not  found  error  as  it  doesn't  exist  where  as  mysql_query  does.
 
 The  only  difference  between  using  procedual  coding  and  OOP  coding  is  that  $db  is  linked  in  directly  with  nukes  database  and  error  caching  so  its  a  lot  better  in  the  long  run.  People  who  say  not  to  use  $db  when  using  Nuke  are  idiots  because  its  not  correct  and  they  need  to  go  back  and  learn  how  to  code  again.
Back to top
View user's profile Send private message Visit poster's website
Sponsor
phpstorm.jpg
SnakZ
Xtreme Contributor
Xtreme Contributor



Gender: Gender:Male
Joined: Jul 14, 2010
Age: 31
Posts: 735
Location: MD
Reputation: 70.9
votes: 4
usa.png


Status: Offline
Web Control Panel: xampp 1.7.4
PostPosted: Tue Feb 01, 2011 8:04 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 yeah  i  didnt  mean  using  sql_  i  mean  using  mysql_query  lol
 and  ty  u  for  that  info  was  not  sure  as  everything  was  working  fine  but  wanted  to  make  sure  what  way  was  the  right  way  to  code  it
 
 and  ty  you  for  that  list  there  was  a  few  i  didnt  know  of  Very Happy


Last edited by SnakZ on Tue Feb 01, 2011 9:12 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger Visit member's Facebook: 720050661 MySpace Profile: zzsnakzz
SgtLegend
Site Admin
Site Admin
Lead Developer
Lead Developer
DFG Developer
DFG Developer



Gender: Gender:Male
Joined: Oct 11, 2008
Age: 26
Posts: 5169
Location: Australia
Reputation: 616.1
votes: 27
australia.png


Status: Offline
Web Control Panel: WHM
PostPosted: Tue Feb 01, 2011 8:19 pm Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 No  problem,  if  you  look  in  includes/db/mysql.php  you  will  find  there  is  a  lot  more  methods  then  that
Back to top
View user's profile Send private message Visit poster's website
SnakZ
Xtreme Contributor
Xtreme Contributor



Gender: Gender:Male
Joined: Jul 14, 2010
Age: 31
Posts: 735
Location: MD
Reputation: 70.9
votes: 4
usa.png


Status: Offline
Web Control Panel: xampp 1.7.4
PostPosted: Wed Feb 02, 2011 12:19 am Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 $db->sql_fetchrowset  is  not  working  ?
 
 but  mysql_fetch_array  works  just  fine
 
 
 
                                                 
Code:                

 
 function  videocontent($id,  $title,  $id5,  $id3)  {
  Â   Â global  $admin,  $uimages,  $prefix,  $db,  $module_name,  $anonpost,  $board_config,  $error_code_video_main;
 
 include_once(NUKE_BASE_DIR.'includes/custom_files/Video_Z_header.php');
 OpenTable();
 
 
 if  Â (!ctype_digit($id)){
 echo  "FAIL!!!";
 if($error_code_video_main==1){
 echo  "<br><center>Error  Code:323231  <center><br>";}
 CloseTable();
 include_once(NUKE_BASE_DIR.'footer.php');
 exit;
 }
 
 
 $db->sql_query("UPDATE  videos  SET  hits=hits+1  WHERE  id='$id'");
 
 
 $ddata  =  $db->sql_query("SELECT  *  FROM  videos  ")  or  die(error());  
 $llist  =  $db->sql_fetchrowset(  $ddata  );  
 $title  =  $llist['title'];
 
 
 
 Print  "".  $ddata['hits']  ."".$llist['id']."
 <table  border=\"0\"  height=\"100%\"  width=\"100%\">
 <tr><td  class=\"background2\">
 <strong>..::<h1>$title  ";if($ep  >  0){
 Print  "  "._EPISODES."  $ep";
 }
 
 
 
 Print  "<h1>::..</strong>
 </td></tr></table>";
 
 
 
 CloseTable();
 include_once(NUKE_BASE_DIR.'footer.php');
 }
                 

 
 edit:
 i  want  ahead  and  look  at  that  file  u  was  talking  about  and  seen  $db->sql_fetchrow  having  something  to  do  with  mysql_fetch_array  what  work  just  fine  for  me  (should  i  use  it  meh  idk  but  it  works  lol)


Last edited by SnakZ on Wed Feb 02, 2011 12:25 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger Visit member's Facebook: 720050661 MySpace Profile: zzsnakzz
Sponsor
phpstorm.jpg
SgtLegend
Site Admin
Site Admin
Lead Developer
Lead Developer
DFG Developer
DFG Developer



Gender: Gender:Male
Joined: Oct 11, 2008
Age: 26
Posts: 5169
Location: Australia
Reputation: 616.1
votes: 27
australia.png


Status: Offline
Web Control Panel: WHM
PostPosted: Wed Feb 02, 2011 12:23 am Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 See  what  happens  if  you  add  the  following  after  the  fetchrowset  statement
 
 
                                                 
Code:                
var_dump($llist);                
Back to top
View user's profile Send private message Visit poster's website
SnakZ
Xtreme Contributor
Xtreme Contributor



Gender: Gender:Male
Joined: Jul 14, 2010
Age: 31
Posts: 735
Location: MD
Reputation: 70.9
votes: 4
usa.png


Status: Offline
Web Control Panel: xampp 1.7.4
PostPosted: Wed Feb 02, 2011 12:31 am Post subject: No icon Re: A question about setting up SQL queery in this CMS Reply with quote

 u  posted  before  i  got  my  edited  out  lol
 
 i  want  ahead  and  look  at  that  file  u  was  talking  about  and  seen  $db->sql_fetchrow  having  something  to  do  with  mysql_fetch_array  what  work  just  fine  for  me  (should  i  use  it  meh  idk  but  it  works  lol)
 
 and  maybe  i  should  of  look  to  see  what  that  code  u  posted  did  before  i  used  it  lol  it  try  to  load  everything  in  the  database  lol  but  yeah  what  u  told  me  to  post  did  pull  everything  from  that  row
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger Visit member's Facebook: 720050661 MySpace Profile: zzsnakzz
Display posts from previous:
Post new topic  Reply to topic   printer-friendly view   Thank Post Evolution-Xtreme Forum Index ->  General Support All times are UTC - 5 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Announcement: Evolution-Xtreme on Open Source CMS Site 3 killigan 5017 Tue Oct 12, 2010 9:36 am
coopvet2000 View latest post
No new posts Announcement: New CMS - :) 1 VicToMeyeZR 3952 Tue Dec 08, 2009 11:41 am
lucastakahashi View latest post
No new posts cms 2 hlm27311 1283 Wed Dec 07, 2011 8:31 pm
SgtLegend View latest post
No new posts backing up entire cms 2 Code-X 1791 Sat Nov 12, 2011 9:31 am
Code-X View latest post
No new posts Help ready to upgrade cant find right CMS 4 heatsinkbod 2493 Tue Nov 23, 2010 11:56 am
Thomas View latest post
 




Powered by phpBB © 2001, 2006 phpBB Group
EvoXtreme Theme by SgtLegend ©
Forums ©