Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old July 10th, 2003, 07:27 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
SQL Php web page Issue.

Hi,
I have a problem with some pages of an Internet site not working properly. The pages all access the SQL /PHP database using a php ID call. From the PHP admin page all the data seems to be there but the result web page says there are no database entries.

Just to see if any data has been lost I have tried using backed up SQL data but this also gives the same problem.

The php code has not changed for the pages either.

Any ideas of what might cause this?

Thanks in advance.

Ronan.

Reply With Quote
  #2  
Old July 10th, 2003, 07:37 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 10700 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 46 m 16 sec
Reputation Power: 4
RE: SQL Php web page Issue.

Posting your code might help us....

Reply With Quote
  #3  
Old July 10th, 2003, 08:38 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: SQL Php web page Issue.

Hi,

Here's the code, It has'nt changed. It's not until this code calls eventsmore.php3 the problem shows up which I cant undersatnd. It seems to retrive some data but not the eventsmore.php request....

events.php3....

<table cellspacing=1 cellpadding=2 border=0 width=600 valign=top background=bgplain.gif>

<tr>
<td bgcolor=#aedaff valign=top colspan=2>
<center>
<font color=003366 face=arial size=2><B>Latest News</B></font>
</center>
</TD></TR>
<?php require("db.php3"); ?>


<?
$result = mysql_query("SELECT * FROM events");



$numrows = mysql_num_rows($result);
if($numrows == 0) {

echo("There are no events in database.");
}
while($row = mysql_fetch_array($result)) {

echo("


<tr>
<td align=left valign=top>
<font face=arial size=2 color=#aedaff><B>
$row[headline]</B>
</td></tr>


<tr>
<td align=left valign=top width=25%>
<font face=arial size=2 color=ffffff>
<I><B>$row[brief]</B></I>
</td></tr>

<tr>
<td align=left valign=bottom>
<a href="eventsmore.php3?id=$row[id]"><font face=arial size=1 color=orange><img src=images/bullet.gif border=0 > Read Article </a>
</font></td></tr>

<tr><td colspan=2>&nbsp;</td></tr>

");

}

?>
</table>



eventsmore.php3....

<?php require("header2.php3"); ?>


<table cellspacing=1 cellpadding=3 background=bgplain.gif border=0 width=600 valign=top width=400 >

<tr>
<td bgcolor=#aedaff width=100% align=top colspan=2>
<center>
<font color=003366 face=arial size=2><B>Latest News</B></font>
</center>
</TD></TR>
<?php require("db.php3"); ?>


<?
$result = mysql_query("select * from events where id = '$id'");



$numrows = mysql_num_rows($result);
if($numrows == 0) {

echo("There are no news in database.");
}
while($row = mysql_fetch_array($result)) {

echo("


<tr>
<td align=left valign=top width=600 >
<font face=arial size=2 color=#aedaff>
<B>
$row[headline]
</B>
</td></tr>


<tr>

<td align=left valign=top width=600 >
<font face=arial size=2 color=ffffff>
<I><B>
$row[brief]
</I></B>
</td></tr>


<tr>

<td align=left valign=top width=600 >
<font face=arial size=2 color=ffffff>
$row[complete]
</td></tr>

<tr><td colspan=2>&nbsp;</td></tr>

");

}



?>
</table>

<?php require("footer2.php3"); ?>

Reply With Quote
  #4  
Old July 10th, 2003, 09:09 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 10700 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 46 m 16 sec
Reputation Power: 4
RE: SQL Php web page Issue.

Try this:

In eventsmore.php3:
php Code:
Original - php Code
  1.  
  2. $result = mysql_query("select * from events where id = '$id'");


Before this line add:
$id= $_GET['id'];

In case this doesnt help, tell us about the errors you get...

Reply With Quote
  #5  
Old July 10th, 2003, 10:09 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: SQL Php web page Issue.

Hey,

Thanks for you reply, yeap that seems to work for the busted pages, there's only one problem left on a search page which again puts query to the database...

I tried to interpret your great fix to no result can you advise once again?

Thanks again for your great help in advance...

Here's the code..

<?php require("header2.php3"); ?>
<table cellspacing=1 cellpadding=2 border=0 width=600 valign=top background=bgplain.gif>

<tr><td colspan=2 bgcolor=#aedaff align=center valign=middle><font size=2 color=#003366><B>
Search Results</B>
</td></tr>
<?php require("db.php3"); ?>


<?

$result = mysql_query("select * FROM abstracts where titleab like '%$searchname%' or authors like '%$searchname%' or journal like '%$searchname%' or abstract like '%$searchname%'");



$numrows = mysql_num_rows($result);
if($numrows == 0) {

echo("<table width=600 background=bgplain.gif><tr><td align=center><br><b>There are no Abstracts in the database matching your search criteria please refine your search. &nbsp; <a href=abstracts.html><font color=orange>Go Back</a></b></td></tr></table>");
}
while($row = mysql_fetch_array($result)) {

echo("


<tr>
<td align=right valign=top width=25%>
<font face=arial size=1 color=orange>

<B>Title: </B>
</td>
<td align=left valign=top>
<font face=arial size=1 color=ffffff>

<B>$row[titleab]</B>
</td></tr>


<tr>
<td align=right valign=top width=25%>
<font face=arial size=1 color=orange>

<B>Authors: </B>
</td>
<td align=left valign=top>
<font face=arial size=1 color=ffffff>

$row[authors]
</td></tr>

<tr>
<td align=right valign=top width=25%>
<font face=arial size=1 color=orange>

<B>Journal/Conference: </B>
</td>
<td align=left valign=top>
<font face=arial size=1 color=ffffff>

$row[journal]
</td></tr>

<tr>
<td align=right valign=top width=25%>
<font face=arial size=1 color=orange>

<B>Date: </B>
</td>
<td align=left valign=top>
<font face=arial size=1 color=ffffff>

$row[date]
</td></tr>

<tr>
<td align=right valign=top>
&nbsp;
</td>
<td align=left valign=bottom>
<a href="abstractsmore.php3?id=$row[id]"><font face=arial size=1 color=orange><img src=images/bullet.gif border=0 > Complete Abstract </a>
</font></td></tr>




<tr><td colspan=2 align=right>&nbsp; <a href=abstracts.html><font color=#aedaff><img src=images/bulletback.gif border=0>&nbsp;<B>Go Back</a></b><P></td></tr>

");

}

?>
</table>
<?php require("footer2.php3"); ?>

Reply With Quote
  #6  
Old July 10th, 2003, 10:30 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 10700 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 46 m 16 sec
Reputation Power: 4
RE: SQL Php web page Issue.

I assume that $searchname comes from a form, right? The try putting
$searchname=$_GET['searchname'];
or
$searchname=$_POST['searchname'];
before you query. Use $_GET if your form uses get method and $_POST if it uses POST method.

Reply With Quote
  #7  
Old July 11th, 2003, 07:11 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: SQL Php web page Issue.

Hi,

I have tried adding the $serachname=$_post , but still is'nt working. I still dont understand what has happened to the site. Everything worked without the additions before. I have a page that allows edits of the site, and additions to the database. This also is not working, again why I dont understand.

anyway thanks for your time and efforts !

I'll have a good look again and see if I can be specific on what is causing my problem.

Ronan.

Reply With Quote
  #8  
Old July 11th, 2003, 07:48 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 10700 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 46 m 16 sec
Reputation Power: 4
RE: SQL Php web page Issue.

how about $searchname = $_GET['searchname'];

If it worked before w/out these but now requires these, then something of someone has turned register_globals OFF in php.ini file.

Reply With Quote
  #9  
Old July 11th, 2003, 08:06 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: SQL Php web page Issue.

Hi,

Where would I find this php.ini file and how can I reset this " register_globals" back to on ?

Thanks in advance...

r.

Reply With Quote
  #10  
Old July 11th, 2003, 08:20 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: SQL Php web page Issue.

I have found this php.ini file in winnt and it is turned on.....

r.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > SQL Php web page Issue.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway