FPDF Display Data From Database Outside The Tableresource id #4 Why am I getting this?PHP resource id #4FPDF Display Data From Database Outside The Table Doesn't WorkTruncate all tables in a MySQL database in one command?Duplicating a MySQL table, indices, and dataHow to take backup of a single table in a MySQL database?How to get the sizes of the tables of a MySQL database?SQL query return data from multiple tablescreating fpdf from mysql query - how to not add empty values to pdfHow to pass variables and data from PHP to JavaScript?Fpdf Selecting Data from databaseFPDF html table to display data from mysqlFPDF Display Data From Database Outside The Table Doesn't Work

Is swap gate equivalent to just exchanging the wire of the two qubits?

How can I prevent a user from copying files on another hard drive?

Harmonic Series Phase Difference?

First occurrence in the Sixers sequence

I just entered the USA without passport control at Atlanta airport

How to address players struggling with simple controls?

How did Frodo know where the Bree village was?

How to ask if I can mow my neighbor's lawn

How would Japanese people react to someone refusing to say “itadakimasu” for religious reasons?

Is this broken pipe the reason my freezer is not working? Can it be fixed?

Is using Legacy mode is a bad thing to do?

How to make a villain when your PCs are villains?

Why was New Asgard established at this place?

Does anyone recognize these rockets, and their location?

Print the new site header

Using roof rails to set up hammock

I'm yearning in grey

Simplify, equivalent for (p ∨ ¬q) ∧ (¬p ∨ ¬q)

Are there examples of rowers who also fought?

What is this plant I saw for sale at a Romanian farmer's market?

Is there any possible way to get these hearts as Adult Link?

Derivation of CDF of a function that results in an exponential distribution

In windows systems, is renaming files functionally similar to deleting them?

I have found ports on my Samsung smart tv running a display service. What can I do with it?



FPDF Display Data From Database Outside The Table


resource id #4 Why am I getting this?PHP resource id #4FPDF Display Data From Database Outside The Table Doesn't WorkTruncate all tables in a MySQL database in one command?Duplicating a MySQL table, indices, and dataHow to take backup of a single table in a MySQL database?How to get the sizes of the tables of a MySQL database?SQL query return data from multiple tablescreating fpdf from mysql query - how to not add empty values to pdfHow to pass variables and data from PHP to JavaScript?Fpdf Selecting Data from databaseFPDF html table to display data from mysqlFPDF Display Data From Database Outside The Table Doesn't Work






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm re-posting my question so that it'll gain more audience. Seems like the others doesn't see it since I posted it last week.



I'm displaying a data outside and inside the table. When I tried to call the data on inside the table, it works perfectly fine but whenever I call it outside, it suddenly doesn't show. This part right here...



$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');


My PDF currently look like this.



enter image description here



Can somebody help me figure out what is wrong or missing with my codes?



<?php

require("con.php");

$sql="SELECT * FROM table ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";

$records=mysql_query($sql);
$fetch = $records[0];

require("library/fpdf.php");

class PDF extends FPDF
function Header()

function Footer()



$pdf = new PDF('p', 'mm', 'Legal');
$title = 'Storm Surge Warning';
$pdf->SetTitle($title);
$pdf->AliasNbPages('pages');
$pdf->SetAutoPageBreak(true,40);

$pdf->AddPage();
$pdf->Ln();

$pdf->SetFont('Arial', 'B', 10);

$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');

$pdf->Ln(1);

$pdf->SetBorders(array('LT', 'LT', 'LT', 'LT', 'TLR'));
$pdf->SetWidths(array(25, 27, 35, 54, 53));
$pdf->SetAligns(array('C', 'C', 'C', 'L', 'L'));

$pdf->SetFont('Arial', 'B', 10);

$pdf->Row(array("SS Height",
"Provinces",
"Low Lying Coastal Areas in the Municipalities of:",
"IMPACTS",
"ADVICE/Actions to Take"), 1);

$pdf->SetFont('Arial', '', 11);


while($row = mysql_fetch_array($records))
$pdf->Row(array($row['ssh'],
$row['provi'],
$row['muni'],
$row['impact'],
$row['advice']), 1);


$pdf->SetBorders(array('T', 'T', 'T', 'T', 'T'));
$pdf->Row(array('','','','',''), 1, false, 1);

$pdf->OutPut();
?>









share|improve this question






















  • You need to solve your basic issue which is retrieving values from your database ($fetch variable in this case). As discussed in your previous question if you print_r($records); right after your query what does it show? What are the results if you run that query in PHPmyAdmin or similar tool?

    – Dave
    Mar 27 at 16:05











  • @Dave it displays the data that i am calling.

    – desteen
    Apr 1 at 3:09

















0















I'm re-posting my question so that it'll gain more audience. Seems like the others doesn't see it since I posted it last week.



I'm displaying a data outside and inside the table. When I tried to call the data on inside the table, it works perfectly fine but whenever I call it outside, it suddenly doesn't show. This part right here...



$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');


My PDF currently look like this.



enter image description here



Can somebody help me figure out what is wrong or missing with my codes?



<?php

require("con.php");

$sql="SELECT * FROM table ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";

$records=mysql_query($sql);
$fetch = $records[0];

require("library/fpdf.php");

class PDF extends FPDF
function Header()

function Footer()



$pdf = new PDF('p', 'mm', 'Legal');
$title = 'Storm Surge Warning';
$pdf->SetTitle($title);
$pdf->AliasNbPages('pages');
$pdf->SetAutoPageBreak(true,40);

$pdf->AddPage();
$pdf->Ln();

$pdf->SetFont('Arial', 'B', 10);

$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');

$pdf->Ln(1);

$pdf->SetBorders(array('LT', 'LT', 'LT', 'LT', 'TLR'));
$pdf->SetWidths(array(25, 27, 35, 54, 53));
$pdf->SetAligns(array('C', 'C', 'C', 'L', 'L'));

$pdf->SetFont('Arial', 'B', 10);

$pdf->Row(array("SS Height",
"Provinces",
"Low Lying Coastal Areas in the Municipalities of:",
"IMPACTS",
"ADVICE/Actions to Take"), 1);

$pdf->SetFont('Arial', '', 11);


while($row = mysql_fetch_array($records))
$pdf->Row(array($row['ssh'],
$row['provi'],
$row['muni'],
$row['impact'],
$row['advice']), 1);


$pdf->SetBorders(array('T', 'T', 'T', 'T', 'T'));
$pdf->Row(array('','','','',''), 1, false, 1);

$pdf->OutPut();
?>









share|improve this question






















  • You need to solve your basic issue which is retrieving values from your database ($fetch variable in this case). As discussed in your previous question if you print_r($records); right after your query what does it show? What are the results if you run that query in PHPmyAdmin or similar tool?

    – Dave
    Mar 27 at 16:05











  • @Dave it displays the data that i am calling.

    – desteen
    Apr 1 at 3:09













0












0








0








I'm re-posting my question so that it'll gain more audience. Seems like the others doesn't see it since I posted it last week.



I'm displaying a data outside and inside the table. When I tried to call the data on inside the table, it works perfectly fine but whenever I call it outside, it suddenly doesn't show. This part right here...



$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');


My PDF currently look like this.



enter image description here



Can somebody help me figure out what is wrong or missing with my codes?



<?php

require("con.php");

$sql="SELECT * FROM table ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";

$records=mysql_query($sql);
$fetch = $records[0];

require("library/fpdf.php");

class PDF extends FPDF
function Header()

function Footer()



$pdf = new PDF('p', 'mm', 'Legal');
$title = 'Storm Surge Warning';
$pdf->SetTitle($title);
$pdf->AliasNbPages('pages');
$pdf->SetAutoPageBreak(true,40);

$pdf->AddPage();
$pdf->Ln();

$pdf->SetFont('Arial', 'B', 10);

$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');

$pdf->Ln(1);

$pdf->SetBorders(array('LT', 'LT', 'LT', 'LT', 'TLR'));
$pdf->SetWidths(array(25, 27, 35, 54, 53));
$pdf->SetAligns(array('C', 'C', 'C', 'L', 'L'));

$pdf->SetFont('Arial', 'B', 10);

$pdf->Row(array("SS Height",
"Provinces",
"Low Lying Coastal Areas in the Municipalities of:",
"IMPACTS",
"ADVICE/Actions to Take"), 1);

$pdf->SetFont('Arial', '', 11);


while($row = mysql_fetch_array($records))
$pdf->Row(array($row['ssh'],
$row['provi'],
$row['muni'],
$row['impact'],
$row['advice']), 1);


$pdf->SetBorders(array('T', 'T', 'T', 'T', 'T'));
$pdf->Row(array('','','','',''), 1, false, 1);

$pdf->OutPut();
?>









share|improve this question














I'm re-posting my question so that it'll gain more audience. Seems like the others doesn't see it since I posted it last week.



I'm displaying a data outside and inside the table. When I tried to call the data on inside the table, it works perfectly fine but whenever I call it outside, it suddenly doesn't show. This part right here...



$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');


My PDF currently look like this.



enter image description here



Can somebody help me figure out what is wrong or missing with my codes?



<?php

require("con.php");

$sql="SELECT * FROM table ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";

$records=mysql_query($sql);
$fetch = $records[0];

require("library/fpdf.php");

class PDF extends FPDF
function Header()

function Footer()



$pdf = new PDF('p', 'mm', 'Legal');
$title = 'Storm Surge Warning';
$pdf->SetTitle($title);
$pdf->AliasNbPages('pages');
$pdf->SetAutoPageBreak(true,40);

$pdf->AddPage();
$pdf->Ln();

$pdf->SetFont('Arial', 'B', 10);

$pdf->MultiCell(194,4,"STORM SURGE INFORMATION",0,'C', false);
$pdf->Cell(191,4,"STORM SURGE: WARNING # ",0,0,'C');
$pdf->Cell(-136,4,$fetch['warning'],0,1,'C');

$pdf->Cell(172,4,"FOR: TYPHOON ",0,0,'C');
$pdf->Cell(-119,4,$fetch['typhoon'],0,1,'C');

$pdf->Cell(175,4,"ISSUED AT ",0,0,'C');
$pdf->Cell(-135,4,$fetch['date'],0,1,'C');

$pdf->Ln(1);

$pdf->SetBorders(array('LT', 'LT', 'LT', 'LT', 'TLR'));
$pdf->SetWidths(array(25, 27, 35, 54, 53));
$pdf->SetAligns(array('C', 'C', 'C', 'L', 'L'));

$pdf->SetFont('Arial', 'B', 10);

$pdf->Row(array("SS Height",
"Provinces",
"Low Lying Coastal Areas in the Municipalities of:",
"IMPACTS",
"ADVICE/Actions to Take"), 1);

$pdf->SetFont('Arial', '', 11);


while($row = mysql_fetch_array($records))
$pdf->Row(array($row['ssh'],
$row['provi'],
$row['muni'],
$row['impact'],
$row['advice']), 1);


$pdf->SetBorders(array('T', 'T', 'T', 'T', 'T'));
$pdf->Row(array('','','','',''), 1, false, 1);

$pdf->OutPut();
?>






php mysql fpdf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 5:10









desteendesteen

627




627












  • You need to solve your basic issue which is retrieving values from your database ($fetch variable in this case). As discussed in your previous question if you print_r($records); right after your query what does it show? What are the results if you run that query in PHPmyAdmin or similar tool?

    – Dave
    Mar 27 at 16:05











  • @Dave it displays the data that i am calling.

    – desteen
    Apr 1 at 3:09

















  • You need to solve your basic issue which is retrieving values from your database ($fetch variable in this case). As discussed in your previous question if you print_r($records); right after your query what does it show? What are the results if you run that query in PHPmyAdmin or similar tool?

    – Dave
    Mar 27 at 16:05











  • @Dave it displays the data that i am calling.

    – desteen
    Apr 1 at 3:09
















You need to solve your basic issue which is retrieving values from your database ($fetch variable in this case). As discussed in your previous question if you print_r($records); right after your query what does it show? What are the results if you run that query in PHPmyAdmin or similar tool?

– Dave
Mar 27 at 16:05





You need to solve your basic issue which is retrieving values from your database ($fetch variable in this case). As discussed in your previous question if you print_r($records); right after your query what does it show? What are the results if you run that query in PHPmyAdmin or similar tool?

– Dave
Mar 27 at 16:05













@Dave it displays the data that i am calling.

– desteen
Apr 1 at 3:09





@Dave it displays the data that i am calling.

– desteen
Apr 1 at 3:09












1 Answer
1






active

oldest

votes


















1














You are trying to use negative X-Position value. I hope, that's why it's not working.



do you want something like below:



Example



Use Limit to take Latest Record



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC LIMIT 1";
//echo $sql;
$records=mysql_query($sql);
if (mysql_num_rows($records))
$fetch = mysql_fetch_assoc($records);


$pdf->Ln(10);
$pdf->Cell(194, 4,"STORM SURGE: WARNING # " . $fetch['warning'], 0,0,'C');
$pdf->Ln();
$pdf->Cell(194, 4,"FOR: TYPHOON " . $fetch['typhoon'],0,0,'C');
$pdf->Ln();
$pdf->Cell(194,4,"ISSUED AT " . $fetch['date'],0,0,'C');
$pdf->Ln();

$pdf->Ln(20);


Example



$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"STORM SURGE: WARNING # :", 0,0,'L');
$pdf->setX(125);
$pdf->Cell(60, 4,$fetch['warning'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"FOR: TYPHOON :", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['typhoon'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"ISSUED AT : ", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['date'], 0,0,'L');
$pdf->Ln();


Main Query



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";
//echo $sql;
$records=mysql_query($sql);





share|improve this answer

























  • Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

    – desteen
    Mar 26 at 23:27











  • @desteen, are you getting data in $fetch array?

    – rsm
    Mar 27 at 11:36






  • 1





    Yes, it's working on that part. @rsm

    – desteen
    Mar 27 at 23:29











  • @desteen, please accept my answer. thanks

    – rsm
    Mar 28 at 5:12






  • 1





    i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

    – rsm
    Apr 1 at 6:34











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331558%2ffpdf-display-data-from-database-outside-the-table%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You are trying to use negative X-Position value. I hope, that's why it's not working.



do you want something like below:



Example



Use Limit to take Latest Record



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC LIMIT 1";
//echo $sql;
$records=mysql_query($sql);
if (mysql_num_rows($records))
$fetch = mysql_fetch_assoc($records);


$pdf->Ln(10);
$pdf->Cell(194, 4,"STORM SURGE: WARNING # " . $fetch['warning'], 0,0,'C');
$pdf->Ln();
$pdf->Cell(194, 4,"FOR: TYPHOON " . $fetch['typhoon'],0,0,'C');
$pdf->Ln();
$pdf->Cell(194,4,"ISSUED AT " . $fetch['date'],0,0,'C');
$pdf->Ln();

$pdf->Ln(20);


Example



$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"STORM SURGE: WARNING # :", 0,0,'L');
$pdf->setX(125);
$pdf->Cell(60, 4,$fetch['warning'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"FOR: TYPHOON :", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['typhoon'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"ISSUED AT : ", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['date'], 0,0,'L');
$pdf->Ln();


Main Query



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";
//echo $sql;
$records=mysql_query($sql);





share|improve this answer

























  • Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

    – desteen
    Mar 26 at 23:27











  • @desteen, are you getting data in $fetch array?

    – rsm
    Mar 27 at 11:36






  • 1





    Yes, it's working on that part. @rsm

    – desteen
    Mar 27 at 23:29











  • @desteen, please accept my answer. thanks

    – rsm
    Mar 28 at 5:12






  • 1





    i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

    – rsm
    Apr 1 at 6:34















1














You are trying to use negative X-Position value. I hope, that's why it's not working.



do you want something like below:



Example



Use Limit to take Latest Record



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC LIMIT 1";
//echo $sql;
$records=mysql_query($sql);
if (mysql_num_rows($records))
$fetch = mysql_fetch_assoc($records);


$pdf->Ln(10);
$pdf->Cell(194, 4,"STORM SURGE: WARNING # " . $fetch['warning'], 0,0,'C');
$pdf->Ln();
$pdf->Cell(194, 4,"FOR: TYPHOON " . $fetch['typhoon'],0,0,'C');
$pdf->Ln();
$pdf->Cell(194,4,"ISSUED AT " . $fetch['date'],0,0,'C');
$pdf->Ln();

$pdf->Ln(20);


Example



$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"STORM SURGE: WARNING # :", 0,0,'L');
$pdf->setX(125);
$pdf->Cell(60, 4,$fetch['warning'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"FOR: TYPHOON :", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['typhoon'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"ISSUED AT : ", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['date'], 0,0,'L');
$pdf->Ln();


Main Query



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";
//echo $sql;
$records=mysql_query($sql);





share|improve this answer

























  • Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

    – desteen
    Mar 26 at 23:27











  • @desteen, are you getting data in $fetch array?

    – rsm
    Mar 27 at 11:36






  • 1





    Yes, it's working on that part. @rsm

    – desteen
    Mar 27 at 23:29











  • @desteen, please accept my answer. thanks

    – rsm
    Mar 28 at 5:12






  • 1





    i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

    – rsm
    Apr 1 at 6:34













1












1








1







You are trying to use negative X-Position value. I hope, that's why it's not working.



do you want something like below:



Example



Use Limit to take Latest Record



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC LIMIT 1";
//echo $sql;
$records=mysql_query($sql);
if (mysql_num_rows($records))
$fetch = mysql_fetch_assoc($records);


$pdf->Ln(10);
$pdf->Cell(194, 4,"STORM SURGE: WARNING # " . $fetch['warning'], 0,0,'C');
$pdf->Ln();
$pdf->Cell(194, 4,"FOR: TYPHOON " . $fetch['typhoon'],0,0,'C');
$pdf->Ln();
$pdf->Cell(194,4,"ISSUED AT " . $fetch['date'],0,0,'C');
$pdf->Ln();

$pdf->Ln(20);


Example



$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"STORM SURGE: WARNING # :", 0,0,'L');
$pdf->setX(125);
$pdf->Cell(60, 4,$fetch['warning'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"FOR: TYPHOON :", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['typhoon'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"ISSUED AT : ", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['date'], 0,0,'L');
$pdf->Ln();


Main Query



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";
//echo $sql;
$records=mysql_query($sql);





share|improve this answer















You are trying to use negative X-Position value. I hope, that's why it's not working.



do you want something like below:



Example



Use Limit to take Latest Record



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC LIMIT 1";
//echo $sql;
$records=mysql_query($sql);
if (mysql_num_rows($records))
$fetch = mysql_fetch_assoc($records);


$pdf->Ln(10);
$pdf->Cell(194, 4,"STORM SURGE: WARNING # " . $fetch['warning'], 0,0,'C');
$pdf->Ln();
$pdf->Cell(194, 4,"FOR: TYPHOON " . $fetch['typhoon'],0,0,'C');
$pdf->Ln();
$pdf->Cell(194,4,"ISSUED AT " . $fetch['date'],0,0,'C');
$pdf->Ln();

$pdf->Ln(20);


Example



$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"STORM SURGE: WARNING # :", 0,0,'L');
$pdf->setX(125);
$pdf->Cell(60, 4,$fetch['warning'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"FOR: TYPHOON :", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['typhoon'], 0,0,'L');
$pdf->Ln();
$pdf->Cell(60, 4,"", 0,0,'C');
$pdf->Cell(60, 4,"ISSUED AT : ", 0,0,'L');
$pdf->setX(100);
$pdf->Cell(60, 4,$fetch['date'], 0,0,'L');
$pdf->Ln();


Main Query



$sql="SELECT * FROM twothree ORDER BY ssh REGEXP '^[^A-Za-z0-9]' ASC, ssh DESC";
//echo $sql;
$records=mysql_query($sql);






share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 1 at 12:05

























answered Mar 26 at 9:03









rsmrsm

54210




54210












  • Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

    – desteen
    Mar 26 at 23:27











  • @desteen, are you getting data in $fetch array?

    – rsm
    Mar 27 at 11:36






  • 1





    Yes, it's working on that part. @rsm

    – desteen
    Mar 27 at 23:29











  • @desteen, please accept my answer. thanks

    – rsm
    Mar 28 at 5:12






  • 1





    i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

    – rsm
    Apr 1 at 6:34

















  • Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

    – desteen
    Mar 26 at 23:27











  • @desteen, are you getting data in $fetch array?

    – rsm
    Mar 27 at 11:36






  • 1





    Yes, it's working on that part. @rsm

    – desteen
    Mar 27 at 23:29











  • @desteen, please accept my answer. thanks

    – rsm
    Mar 28 at 5:12






  • 1





    i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

    – rsm
    Apr 1 at 6:34
















Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

– desteen
Mar 26 at 23:27





Seems like I got a problem with the $fetch['warning'] $fetch['typhoon'] $fetch['date']. It still doesn't display. @rsm

– desteen
Mar 26 at 23:27













@desteen, are you getting data in $fetch array?

– rsm
Mar 27 at 11:36





@desteen, are you getting data in $fetch array?

– rsm
Mar 27 at 11:36




1




1





Yes, it's working on that part. @rsm

– desteen
Mar 27 at 23:29





Yes, it's working on that part. @rsm

– desteen
Mar 27 at 23:29













@desteen, please accept my answer. thanks

– rsm
Mar 28 at 5:12





@desteen, please accept my answer. thanks

– rsm
Mar 28 at 5:12




1




1





i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

– rsm
Apr 1 at 6:34





i checked ur code. it's working fine for me. please how a look this code pastebin.com/UyDCAtR0

– rsm
Apr 1 at 6:34



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331558%2ffpdf-display-data-from-database-outside-the-table%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript