472,961 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

Resource id #4

3
Hi all,

i'm a new user of PHP,

at the moment, i have queries regarding the "Resource id #4"

everythings run perfectly but before the script showing the result,
it shows the "Resource id #4" in front of the result, and i don't have any clue what happend with it.

Could someone please help me with it.

thanks a lot,
regards,
adi

here is my code:
Expand|Select|Wrap|Line Numbers
  1.     <?php
  2.       require_once('dbconnect.php');         
  3.       $trackID = $_GET['TrackId'];      
  4.       $trackName = mysql_query("SELECT TrackName FROM EHAC_track where TrackId='$trackID'");
  5.       $meetingList = mysql_query("SELECT MeetingID, MeetingDate FROM EHAC_meeting WHERE TrackId='$trackID' ORDER BY MeetingDate");
  6.     ?>
  7.  
  8.           <ul>
  9.             <?php
  10.               error_reporting(E_ALL);
  11.               ini_set('display_errors', true);
  12.               Echo $trackName;
  13.               $count = 0;
  14.               while ($row = mysql_fetch_array($meetingList)) {
  15.                 Echo "<li><a href=raceInformation.php?MeetingID=".$row['MeetingID']." class=\"item-link-1\">".$row['MeetingDate']."</a></li>";                         
  16.                 $count++;
  17.               }
  18.               if($count==0){
  19.                 Echo "<span class=\"header-2\">No date available on this track</span>";
  20.               }
  21.             ?>
  22.           </ul>
Dec 16 '07 #1
6 16555
Markus
6,050 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once('dbconnect.php');
  3. $trackID = $_GET['TrackId'];
  4. $trackName = mysql_query("SELECT TrackName FROM EHAC_track where TrackId='$trackID'");
  5. $meetingList = mysql_query("SELECT MeetingID, MeetingDate FROM EHAC_meeting WHERE TrackId='$trackID' ORDER BY MeetingDate");
  6.  
  7. //instead of stopping the parsing of php just echo-out the <ul>
  8. echo "<ul>";
  9.  
  10. error_reporting(E_ALL);
  11. ini_set('display_errors', true);
  12.  
  13. //this is the problem line
  14. Echo $trackName;
  15. $count = 0;
  16. while ($row = mysql_fetch_array($meetingList)) {
  17. Echo "<li><a href=raceInformation.php?MeetingID=".$row['MeetingID']." class=\"item-link-1\">".$row['MeetingDate']."</a></li>";
  18. $count++;
  19. }
  20. if($count==0){
  21. Echo "<span class=\"header-2\">No date available on this track</span>";
  22. }
  23. ?>
  24.  
Line 14 is the problem.
You need to use one of the provided mysql functions
i.e:
Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track;
  3. }
  4.  
Hope this helps :)
Dec 16 '07 #2
sip3
3
hi,

i have tried it, and you are correct that the problem is from line 14 but after i implement it, it shows "array" instead of "resource id#4".

i don't know why it shows array now.
i'm really sorry to ask a lot of question because i'm really new in here and this is my assignment for my uni.

thanks for the help.
regards,
adi
Dec 16 '07 #3
Markus
6,050 Expert 4TB
Sorry, i forgot a bit of it.

Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track;
  3. }
  4.  
needs to be

Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track[*table_row_name*];
  3. }
  4.  
*table_row_name* needs to be substituted with the appropriate row name.
:)
Dec 16 '07 #4
sip3
3
You are the star Markus :)

thank you very much for your help.

and i might need your help in the near future as i just started my assignment and i believe i will face a lot of trouble in this because i don't have IT background.

once again,

thank you.
regards,
adi
Dec 16 '07 #5
Markus
6,050 Expert 4TB
No problem at all :)

post back whenever you need some help

also, remember to use CODE tags when posting - it helps us work through your code.

-markus
Dec 16 '07 #6
nsr7
1
Hi Markus - Could u plz rectify my code as well??

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if (isset($_POST['verifyotp'])) {
  4.  
  5.     // Authorisation details.
  6.     $username = "foo@bar.foobar";
  7.     $hash = "01993a995a047af1dfe20536da550cf101e571c9f7ba4a05bd6638417d79455f";
  8.  
  9.     // Config variables. Consult http://api.textlocal.in/docs for more info.
  10.     $test = "0";
  11.     $numbers = $_POST['otpnumber'];
  12.  
  13.     // Data for text message. This is the text message data.
  14.     $sender = "TXTLCL"; // This is who the message appears to be from.
  15.     $numbers = $_POST['otpnumber']; // A single number or a comma-seperated list of numbers
  16.     $otp = mt_rand(100000,999999);
  17.     setcookie("otp", $otp);
  18.     $message = "Dear Subscriber Your OTP is ".$otp;
  19.     // 612 chars or less
  20.     // A single number or a comma-seperated list of numbers
  21.     $message = urlencode($message);
  22.     $data = "username=".$username."&hash=".$hash."&message=".$message."&sender=".$sender."&numbers=".$numbers."&test=".$test;
  23.     $ch = curl_init('http://api.textlocal.in/send/?');
  24.     curl_setopt($ch, CURLOPT_POST, true);
  25.     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  26.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27.     $result = curl_exec($ch); // This is the result from the API
  28.  
  29.     curl_close($ch);
  30.  
  31.     if ($ch) {
  32.         echo "CURL Error #: " .$ch;
  33.     }
  34.     else
  35.     {
  36.         $json = json_decode($result);
  37.  
  38.         if ($json->type == 'success') 
  39.         {
  40.             header('location: otpverified.php');
  41.         }
  42.         if ($json->type == 'error') 
  43.         {
  44.             echo 'Your OTP is not Verified "'.$json->message.'" ';
  45.         }    
  46.  
  47. }
  48.  
  49. }
  50.  
  51. ?>
Jul 5 '19 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
5
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
0
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
2
by: WT | last post by:
Hello, Could we use 'Embedded resources' with resx files that contain text resources used in aspx pages with the syntaxe: Text="<%$ Resources:ResourcesMy,KEY1 %>" I tryed removing the...
21
by: DiAvOl | last post by:
Hello, I am using a simple php server that I wrote and have some questions related to the resource id's. When a new client connects to the server or the server opens a file the Resource id...
12
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
by: CSharper | last post by:
Just curious, When you are in IDE, you are able to add a resource to the project through resource tab. Later this resource can be accessed using the resource manager. One good thing about this...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.