[PHP-DB] FWD: Hey there!!

2011-11-05 Thread Nasreen Laghari
phey.brI wanted to prove I could amount to something I knew I had to take 
advantage of this now a weight is lifted off my shoulders you could be living 
the dreambra 
href=http://www.aqa.ru/forum/redirect.php?http://home72solutions.net/esubmit/bizopp_main.php/%3Fcimedamp;95ler=facebook.comamp;95baco=google.com;http://www.aqa.ru/forum/redirect.php?http://home72solutions.net/esubmit/bizopp_main.php/%3Fcimedamp;95ler=facebook.comamp;95baco=google.com/abrtalk
 to you later./p


[PHP-DB] Look what i found...

2011-10-11 Thread Nasreen Laghari
pwhats up!brit was important for me to prove I could amount to something I 
was so lucky to have found this it proved that miracles can happen you are 
definitely cut out for thisbra 
href=http://powen.home.pl/DanielEvans13.html;http://powen.home.pl/DanielEvans13.html/abrsee
 you./p


[PHP-DB] Bulk Insert from text file

2008-09-23 Thread Nasreen Laghari
Hi All,

I have bulk data store in text file, which is attached with this email. Could 
any 1 please help on how to insert using phpMyAdmin??

I tried using below code but getting Error in SQL Syntax:

BULK 
INSERT venue  FROM 'c:\venues.txt' 
WITH
(   FIELDTERMINATOR = ',')



Any help will be appreciated.



Regards,


Nasreen


  

[PHP-DB] Import Excel sheet into SQL

2008-09-05 Thread Nasreen Laghari
Hi,
 
How can I import Excel sheet into MS-SQL. The data I have saved in excel sheet 
is in cells, snapshot is attached in this email. 
 
I am using sqlmyAdmin. and tried using import but getting error Invalid Count 
on line1
 
 
 
Help required!!!
 
 
Nasreen


  -- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Run SQL query when click on OK button of warning message

2008-07-27 Thread Nasreen Laghari
  Hi All,

I am printing a _javascript_warning message. On pressing OK button, I want to run an sql query. Below is the way I have tried but sql query is running either press OK or Cancel button on warning message or even refresh the page (F5). Also redirection, when press OK, also not working.


Am I using the right approach? Could any 1 please help me to sort this problem.


Regards,

Nasreen



trtd
input type="button" DELETE FROM artist where aid = '$id'";mysql_query($sqldel) or die(mysql_error());//header("Location: artist.php");//window.location="http://www.yahoo.com/"?}else{window.location='index.php' }" value="DELETE"
/td/tr  

  

[PHP-DB] Create Search engine with multiple form fields

2008-06-29 Thread Nasreen Laghari
Hi,
 
I have an HTML form which has more then one fields. User can precise its search 
using one or more input fields E.g GigName,Date, Genre,Venue. 
The data is coming from 3 tables.  Below Query brings one tables record with 
each and every row of other two tables. Could any one please help me sort out 
the query.
 
select * FROM gig g, venue v, genre ge  WHERE g.gigName LIKE '%.$gig_name.%' 
OR g.gig_date LIKE '%.$sdate.%' OR ge.name LIKE '%.$genre.%' OR 
g.ticket_price LIKE '%.$ticket_price1.%' OR g.ticket_price LIKE 
'%.$ticket_price2.%' OR v.venueName LIKE '%.$vname.%'
 
If I replace OR with AND I dont get any result.
 
 
Regards
 
Nasreen


  

[PHP-DB] Help in concatenation

2008-06-06 Thread Nasreen Laghari
Hi,
 
I need to change PHP embeded in HTML to HTML embeded in PHP as trying to use 
modularity approach.
I'm stuck on below these lines where concatenation is the big issue. I have 
researched, read but couldnt sort this out after try really hard.
Could any one please help me to change this code to HTML embeded in PHP please. 
Mostly i'm getting confuse where text is written in red
I know it is very basic question but this concatenation is confusing me so 
much. I have spended my whole day in sorting this out but :(
1. 
a class=?php print($class);? href=?php print($thispage.($y0?(?start=).$y:));??php print($pg);?/a
2.  a href=?php print($thispage.($next0?(?start=).$next:));?/a 
Thank you


  

[PHP-DB] Navigation Help

2008-06-04 Thread Nasreen Laghari
Hi,
Could any one please help me with Page Navigation. I have done Next and 
Previous page Navigation but confused on printing page numbers (1,2,3,4) and 
hyperlink them. Below is the code which i'm halfway on but it only prints 1 
with no hyperlink where as I have 11 pages, if i print $noPages.
Could you please correct where i'm mistaking.
 $result = safe_query(select count(*) FROM gig g, venue v WHERE g.gigName LIKE 
'%.$gig_name.%' );
 $noEntries = mysql_num_rows($result);
 $noPages = ceil($noEntries / $limit);
  $currentPage = 0;
 if(isset($_GET['pag'])  
    is_numeric($_GET['pag'])  
    $_GET['pag']  0  
    $_GET['pag']  $noPages){

    $currentPage = $_GET['pag'];
 }
 $start = $currentPage * $pageLimit;
  $sqlTotal = select * FROM gig g, venue v WHERE g.gigName LIKE 
'%.$gig_name.%' .$start.,.$limit;
 for($a = 0; $a  $noPages; $a++){
    if($currentPage == $a){ 
    echo($a+1);
    }else{
    echo 'a href='.$_SERVER['PHP_SELF'].'?spag='.$a.''.($a+1).'/a';
    }
    if($a  $noPages - 1){
    echo '-';
    }
}


  

[PHP-DB] How to do a Newsletter

2008-05-01 Thread Nasreen Laghari
Hi,
Does any one know a better way of doing Newsletter. I have to run a query and 
send that data to clients. 
Regards


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Re: [PHP-DB] How to do a Newsletter

2008-05-01 Thread Nasreen Laghari
I have to email it. Basically I have run a query according to user criteria of 
newsletter and send it via email


- Original Message 
From: Jason Pruim [EMAIL PROTECTED]
To: Nasreen Laghari [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Thursday, May 1, 2008 5:03:43 PM
Subject: Re: [PHP-DB] How to do a Newsletter

That's not an awful lot to go off of.. I'm assuming the actual  
newsletter is already produced probably in a PDF?

Are you looking to e-mail it out?

Post it to a website?

Get e-mail addresses to e-mail it to?

Get postal addresses to postal mail it to?

More info I think would definitely help.


On May 1, 2008, at 11:59 AM, Nasreen Laghari wrote:

 Hi,
 Does any one know a better way of doing Newsletter. I have to run  
 a query and send that data to clients.
 Regards


      
 
 Be a better friend, newshound, and
 know-it-all with Yahoo! Mobile.  Try it now.  
 http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
[EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[PHP-DB] Why $row is EMPTY

2008-04-29 Thread Nasreen Laghari
Hi,
Why my program is not going in while loop? When I run the same query in SQL 
cmd, it brings result but here when I print $result gives Resouce ID number 
means $result has data then why $row is empty.
$query = 'SELECT * FROM `gig` LEFT JOIN genre ON gig.genreId=genre.genreId LEFT 
JOIN venue ON gig.venueID = venue.vid where gig.gigid = '.$gigDetail.' ORDER BY 
gig.gigid';
 
 $result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) 
  {
  echo Program is in While loop;
  $g_name = $row[gig.gigName]; 
      $vname = $row[venue.venueName];
      $genre = $row[genre.name];
      echo(Gig Name: .$g_name);
}   
Regards
Nasreen


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[PHP-DB] Query Criteria

2008-04-28 Thread Nasreen Laghari
Hi All,
I need help in below coding as it is not working.
What I'm trying to do here, if $type contains today value then bring all 
record which has today's date, If $type contains tomorrow bring all 
tomorrow's record. 
Do you think below coding is correct? becuase when I run this query I get 
exception but if I place only one $query and outside of if.. else  the same 
query runs without errors.
 
 
Thank you for your help
 
Regards
 
$query;

$date = date(d/m/y);

  if($type==today)
{
  $query = SELECT * FROM gig where gig_Date= $date;
}
else if($type==tomorrow)
{
  $tomorrow  = mktime(0, 0, 0, date(m)  , date(d)+1, date(Y));
  $query = SELECT * FROM gig where gig_Date= $tomorrow;

}
else if($type==week)
{
  $week  = mktime(0, 0, 0, date(m)  , date(d)+6, date(Y));
  $query = SELECT * FROM gig WHERE g.gig_Date = .$date. OR g.gig_Date 
=.$week.;
  
}

$result = mysql_query($query)or die(mysql_error());


  return $result;
  }



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[PHP-DB] A very basic PHP question

2008-04-25 Thread Nasreen Laghari
Hi,
   
  I have some confusion with Variables scope. I searched but couldn't figure it 
out :(
   
  The question is:
  one variable which changes according to if... else statment, how do you 
change the value of that variable?
   
  Actually $query is changing on $type variable so I tried doing using if.. 
else statment. Please clarify me.
   
  function select_entries_quick ($offset=0,$location,$type)
{
 
 global $limit;
 $query;
 $date = date(d/m/y);

   if (empty($offset)) { $offset = 0; }
   if($type==today)
 {
  $query = SELECT * FROM gig where gig_Date= $date;
 }
 else if($type==tomorrow)
 {
  $tomorrow  = mktime(0, 0, 0, date(m)  , date(d)+1, date(Y));
   $query = SELECT * FROM gig where gig_Date= $tomorrow;

 }
 else if($type==week)
 {
  $week  = mktime(0, 0, 0, date(m)  , date(d)+6, date(Y));
  $query = SELECT * FROM gig WHERE g.gig_Date = .$date. OR g.gig_Date 
=.$week.;
  
 }
 
 $result = safe_query($query);
 
 
   return $result;
  }
 

   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Nasreen Laghari
Hi,
 
I have a table which contains 2 foreign key relation columns. I'm trying to get 
all columns from main table as well as all column from those 2 foreign key 
relation tables. 
 
The query i'm using is :
 
select * from gig where gig.gigid = $gigDetail LEFT JOIN genre ON 
gig.genreId=genre.genreId LEFT JOIN venue ON gig.venueID = venue.vid ORDER BY 
gig.gigid; 
 
is this query OK? 
 
I know  how to get value from gig table colums but how could i get value of 
columns from venue table?
 
Regards
 
Nasreen
 
 
 



Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[PHP-DB] Dynamic Navigation with Limit

2008-04-03 Thread Nasreen Laghari
Hi,

I'm trying to put limit of data fetch as well as dynamic navigation. Below is 
the try which I did but something is going wrong as $screen value is not 
increasing so when I click on NEXt button it refreshes the same page and 
Previous button does even show.

Could you kindly have look on the coding and help me where i'm mistaking.

Regards

Nasreen


?php
$rows_per_page = 10;
$i=0;
if (!isset($screen))
 $screen=0; 
$start = $screen * $rows_per_page;
$sql = SELECT * FROM gig g, venue v WHERE g.gigName LIKE '%.$gig_name.%' OR 
g.gig_date LIKE '%.$sdate.%' OR g.genre LIKE '%.$genre.%' OR g.ticket_price 
LIKE '%.$ticket_price1.%' OR g.ticket_price LIKE '%.$ticket_price2.%' OR 
v.venueName LIKE '%.$vname.%' OR v.vCity LIKE '%.$city.%' order by gig_Date 
LIMIT $start,$rows_per_page;
$result = mysql_query($sql) or die(Query error: . mysql_error());
$num_rows = mysql_num_rows($result) ;
$pages = ceil($num_rows / $rows_per_page);
$j=0;
while ($row = mysql_fetch_array($result)) 
{
 global $limit;
 $j = $j+1;
  $gigid = $row['gigid'];
   $gigname = $row['gigName'];
   $sdate = $row['gig_fdate'];
   $fdate =$row['gig_tdate'];
   $genre = $row['genre'];
   $ticket_price = $row['ticket_price'];
   $gigdetail= $gigid;
echo(br $gigid a href='detail.php?gigDetail=$gigid'  $gigname/a);
}

}

if ($screen  0) 
 { 
   print a href=\view.php?$screen=.( $screen+1).\lt;lt;Previous 
Entries/a nbsp; ;
 }
else if ($screen  $pages)
 {
$screen = $screen+1;
  print a href=\view.php?screen=.($screen).\Next Entriesgt;gt;/a 
nbsp; ;
 }

?


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

[PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Nasreen Laghari
Hi All,

Thank you for increasing my knowledge about PHP/MYSQL.

I am creating a SEARCH, by only using one table. The search form  is same as 
Inserting item (search has form of all fields in table ), difference is SEARCH 
page doesnt have validation . Therefore user can enter information in any of 
field. I would like to know how to write a SELECT query which has multiple 
where clause with OR operator.

shall we write:

$query = mysql_query(SELECT * from gig WHERE Name='$name' || WHERE 
gig_fdate='$sdate');

OR

$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' OR WHERE 
gig_fdate='$sdate');

OR

$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' ||  
gig_fdate='$sdate');


Regards

Nasreen


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

[PHP-DB] Password Reset

2008-02-26 Thread Nasreen Laghari
Hi,

I have encrypted password in database and I encrypted using MD5().  As it is a 
one-way Hash so I cant get password back to original text !!!

What encrypting technique I used to encrypt password so if user forget, I can 
decrypt password and email it.


Regards

Nasreen


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

[PHP-DB] INSERT query with Primary and foreign key

2008-02-25 Thread Nasreen Laghari
Hi,

I need help to insert date into two tables when tables have primary and foreign 
key relationship using php. I tried simple INSERT query but foreign key colum 
is storing NULL.

Regards

Nasreen


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


[PHP-DB] Uploading Image using PHP and mySQL

2008-02-18 Thread Nasreen Laghari
Hi All,

First of all A very big thank you to all of you for solving my Password() 
encryption problem.

Now I'm stuck on new problem which is image not uploading.  I'm using the 
following code. 


Regards

Nasreen

?php 

include (header.php);
include (dbconnect.php);

 $submit=$_REQUEST[submit] ;
 $aname=$_REQUEST[aname];
 $aboutu=$_REQUEST[urself];
 $file=$_REQUEST[file];
 $url_provided = $_REQUEST[url_provided];

echo($aname);
if ($submit == Sign!)
{ 

function getImageFile($file){
$takeFile = fopen($file, r);
$file = fread($takeFile, filesize($file));
fclose($takeFile);
return $file;
}
  
function getfileType( $name ){
$name = explode(., $name);
$name = array_reverse($name);
$name = $name[0];
return $name;
}
$allowedImageTypes = array(gif,jpg,png);
if(empty($_FILES['image_file']['tmp_name'])){
echo File not uploaded;
}
else {
$fileType = $_FILES['file']['name'];
if(in_array(getfileType($fileType), $allowedImageTypes)){
$fileContent = getImageFile($_FILES['file']['tmp_name']);
$uploadedImage = chunk_split(base64_encode($fileContent));
$query = INSERT INTO artist (name,about_u,imgdata, profile_url) 
VALUES('$aname','$aboutu','$uploadedImage','$url_provided');

$result = mysql_query($query);
if(mysql_affected_rows()  0){
echo Image has been inserted succesfully;
}
else {
echo Image can not be inserted check your submission;
}
}
else {
echo This is not a true image type;
}
}

}
?
div align=center class=style1
  h1Artist Profile Form/h1
  pnbsp;/p
  form action=artist.php  method=post enctype=multipart/form-data
table width=397 border=0
  tr
th width=221 scope=colh4 align=rightName:/h4/th
th width=166 scope=coldiv align=left
input name=aname type=text id=username3
/div/th
  /tr
  tr
th scope=rowdiv align=rightAbout Yourself /div/th
tddiv align=left
textarea name=urself/textarea
/div/td
  /tr
  tr
th scope=rowdiv align=right Profile export from myspace/face 
book /div/th
tddiv align=left
input name=url_provided type=text id=repass
/div/td
  /tr
  tr
th scope=rowdiv align=rightUpload Photo /div/th
tddiv align=left
  input type=file name=file
/div/td
  /tr
  tr
th scope=rownbsp;/th
  td
  input type=submit name=submit value=Sign!
input type=reset name=Reset value=Reset/td
  /tr
/table
  /form
  pstrong/strong/p
/div


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


[PHP-DB] Uploading Image using PHP and mySQL

2008-02-18 Thread Nasreen Laghari
Hi All,
 
First of all A very big thank you to all of you for solving my Password() 
encryption problem.
 
Now I'm stuck on new problem which is image not uploading.  I'm using the 
following code. 
 
 
Regards
 
Nasreen
 
?php 

include (header.php);
include (dbconnect.php);
 
 $submit=$_REQUEST[submit] ;
 $aname=$_REQUEST[aname];
 $aboutu=$_REQUEST[urself];
 $file=$_REQUEST[file];
 $url_provided = $_REQUEST[url_provided];
 
echo($aname);
if ($submit == Sign!)
{ 
 
function getImageFile($file){
$takeFile = fopen($file, r);
$file = fread($takeFile, filesize($file));
fclose($takeFile);
return $file;
}
  
function getfileType( $name ){
$name = explode(., $name);
$name = array_reverse($name);
$name = $name[0];
return $name;
}
$allowedImageTypes = array(gif,jpg,png);
if(empty($_FILES['image_file']['tmp_name'])){
echo File not uploaded;
}
else {
$fileType = $_FILES['file']['name'];
if(in_array(getfileType($fileType), $allowedImageTypes)){
$fileContent = getImageFile($_FILES['file']['tmp_name']);
$uploadedImage = chunk_split(base64_encode($fileContent));
$query = INSERT INTO artist (name,about_u,imgdata, profile_url) 
VALUES('$aname','$aboutu','$uploadedImage','$url_provided');

$result = mysql_query($query);
if(mysql_affected_rows()  0){
echo Image has been inserted succesfully;
}
else {
echo Image can not be inserted check your submission;
}
}
else {
echo This is not a true image type;
}
}
 
}
?
div align=center class=style1
  h1Artist Profile Form/h1
  pnbsp;/p
  form action=artist.php  method=post enctype=multipart/form-data
table width=397 border=0
  tr
th width=221 scope=colh4 align=rightName:/h4/th
th width=166 scope=coldiv align=left
input name=aname type=text id=username3
/div/th
  /tr
  tr
th scope=rowdiv align=rightAbout Yourself /div/th
tddiv align=left
textarea name=urself/textarea
/div/td
  /tr
  tr
th scope=rowdiv align=right Profile export from myspace/face 
book /div/th
tddiv align=left
input name=url_provided type=text id=repass
/div/td
  /tr
  tr
th scope=rowdiv align=rightUpload Photo /div/th
tddiv align=left
  input type=file name=file
/div/td
  /tr
  tr
th scope=rownbsp;/th
  td
  input type=submit name=submit value=Sign!
input type=reset name=Reset value=Reset/td
  /tr
/table
  /form
  pstrong/strong/p
/div

 
 
 



Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

[PHP-DB] Password decryption

2008-02-16 Thread Nasreen Laghari
Hi,
 
I'm junior in PHP and stuck on Encryption. 
 
I have encrypted password using SQL :
 
$query = insert into user (userid,password,) values 
('$username',Password('$pass'));;
 
Which is working perfect. Now I'm working on Login page where I have to compare 
passwords.. As password in database is encrypted so I need to decrypt it back 
for compression. I have tried the flowing but not working.
 
 if ($pwd != Password($info['password'])) 
  {
   echo(-);
   //header(Location: abuse.php);
  }
 
and 
 
 if ($pwd != $info(Password(['password'])) 
  {
   echo(-);
   //header(Location: abuse.php);
  }
 
Could any one please help..

Thank you


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ